mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
fix flake in detach tests
This commit is contained in:
parent
cf9b5ab95a
commit
4b589dfd7a
@ -1084,7 +1084,6 @@ func (fv *FakeVolume) GetUnmountDeviceCallCount() int {
|
||||
func (fv *FakeVolume) Detach(volumeName string, nodeName types.NodeName) error {
|
||||
fv.Lock()
|
||||
defer fv.Unlock()
|
||||
fv.DetachCallCount++
|
||||
|
||||
node := string(nodeName)
|
||||
volumeNodes, exist := fv.VolumesAttached[volumeName]
|
||||
@ -1092,6 +1091,7 @@ func (fv *FakeVolume) Detach(volumeName string, nodeName types.NodeName) error {
|
||||
return fmt.Errorf("trying to detach volume %q that is not attached to the node %q", volumeName, node)
|
||||
}
|
||||
|
||||
fv.DetachCallCount++
|
||||
if nodeName == FailDetachNode {
|
||||
return fmt.Errorf("fail to detach volume %q to node %q", volumeName, nodeName)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user