Skip to content

Commit 981aae3

Browse files
pohlyjsafrane
authored andcommitted
mock tests: do not give up immediately for pod output errors
As seen in some test runs (https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/89041), retrieving output can fail with "the server rejected our request for an unknown reason (get pods csi-mockplugin-0)". If this truly an intermittent error, then the existing retry logic in the callers can deal with this.
1 parent e23a26a commit 981aae3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/e2e/storage/csi_mock_volume.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,10 +974,14 @@ func parseMockLogs(cs clientset.Interface, namespace, driverPodName, driverConta
974974
// yet or error when calls do not match.
975975
// All repeated calls to the CSI mock driver (e.g. due to exponential backoff)
976976
// are squashed and checked against single expectedCallSequence item.
977+
//
978+
// Only permanent errors are returned. Other errors are logged and no
979+
// calls are returned. The caller is expected to retry.
977980
func compareCSICalls(trackedCalls []string, expectedCallSequence []csiCall, cs clientset.Interface, namespace, driverPodName, driverContainerName string) (int, error) {
978981
allCalls, err := parseMockLogs(cs, namespace, driverPodName, driverContainerName)
979982
if err != nil {
980-
return 0, err
983+
framework.Logf("intermittent (?) log retrieval error, proceeding without output: %v", err)
984+
return 0, nil
981985
}
982986

983987
// Remove all repeated and ignored calls

0 commit comments

Comments
 (0)