Skip to content

Commit d1fb0b5

Browse files
committed
Expect NodeUnpublish calls when NodePublish is called
While this is looser check than original check, I do not think we can quite expect NodePublish and NodeUnpublish call counts to match NodePublishvolume call count may not be same as NodeUnpublishVolume call count because reconciler may have a mount operation queued up while previous one is finishing. So, it is not unusual to have more than one NodePublishVolume call for same pod+volume combination, similarly unmount may also run more than once.
1 parent 5cb1ec5 commit d1fb0b5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/e2e/storage/csi_mock_volume.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,12 @@ func checkPodLogs(cs clientset.Interface, namespace, driverPodName, driverContai
793793
if foundAttributes.Len() != 0 {
794794
return fmt.Errorf("some unexpected volume attributes were found: %+v", foundAttributes.List())
795795
}
796-
if numNodePublishVolume != numNodeUnpublishVolume {
797-
return fmt.Errorf("number of NodePublishVolume %d != number of NodeUnpublishVolume %d", numNodePublishVolume, numNodeUnpublishVolume)
796+
if numNodePublishVolume == 0 {
797+
return fmt.Errorf("NodePublish was never called")
798+
}
799+
800+
if numNodeUnpublishVolume == 0 {
801+
return fmt.Errorf("NodeUnpublish was never called")
798802
}
799803
return nil
800804
}

0 commit comments

Comments
 (0)