e2e test: relax CSI call expectations

NodeUnstageVolume and DeleteVolume are not necessarily ordered and in
practice, DeleteVolume was indeed encountered first after changing the
timing by embedding the CSI driver:

Kubernetes e2e suite: [sig-storage] CSI mock volume storage capacity exhausted, immediate binding expand_less 	7m34s
test/e2e/storage/csi_mock_volume.go:953
Feb 26 18:34:04.037: while waiting for all CSI calls
Unexpected error:
    <*errors.errorString | 0xc00322b9c0>: {
        s: "error waiting for expected CSI calls: Unexpected CSI call 3: expected NodeUnstageVolume (0), got DeleteVolume (0)",
    }
    error waiting for expected CSI calls: Unexpected CSI call 3: expected NodeUnstageVolume (0), got DeleteVolume (0)
occurred
test/e2e/storage/csi_mock_volume.go:1045
This commit is contained in:
Patrick Ohly 2021-02-26 20:48:02 +01:00
parent baecaa8209
commit 5089af1f23

View File

@ -927,9 +927,9 @@ var _ = utils.SIGDescribe("CSI mock volume", func() {
createVolume := "CreateVolume" createVolume := "CreateVolume"
deleteVolume := "DeleteVolume" deleteVolume := "DeleteVolume"
// publishVolume := "NodePublishVolume" // publishVolume := "NodePublishVolume"
unpublishVolume := "NodeUnpublishVolume" // unpublishVolume := "NodeUnpublishVolume"
// stageVolume := "NodeStageVolume" // stageVolume := "NodeStageVolume"
unstageVolume := "NodeUnstageVolume" // unstageVolume := "NodeUnstageVolume"
// These calls are assumed to occur in this order for // These calls are assumed to occur in this order for
// each test run. NodeStageVolume and // each test run. NodeStageVolume and
@ -939,12 +939,17 @@ var _ = utils.SIGDescribe("CSI mock volume", func() {
// (https://github.com/kubernetes/kubernetes/issues/90250). // (https://github.com/kubernetes/kubernetes/issues/90250).
// Therefore they are temporarily commented out until // Therefore they are temporarily commented out until
// that issue is resolved. // that issue is resolved.
//
// NodeUnpublishVolume and NodeUnstageVolume are racing
// with DeleteVolume, so we cannot assume a deterministic
// order and have to ignore them
// (https://github.com/kubernetes/kubernetes/issues/94108).
deterministicCalls := []string{ deterministicCalls := []string{
createVolume, createVolume,
// stageVolume, // stageVolume,
// publishVolume, // publishVolume,
unpublishVolume, // unpublishVolume,
unstageVolume, // unstageVolume,
deleteVolume, deleteVolume,
} }