Skip to content

Commit

Permalink
e2e: isRetryableAPIError() should match any etcdserver timeout
Browse files Browse the repository at this point in the history
framework.RunKubectl() returns an error that does not end with
"etcdserver: request timed out", but contains the text somewhere in the
middle:

    error running /usr/bin/kubectl --server=https://192.168.39.57:8443 --kubeconfig=/root/.kube/config --namespace=cephcsi-e2e-a44ec4b4 create -f -:
    Command stdout:

    stderr:
    Error from server: error when creating "STDIN": etcdserver: request timed out

    error:
    exit status 1

isRetryableAPIError() should  return `true` for this case as well, so
instead of using HasSuffix(), we'll use Contains().

Signed-off-by: Niels de Vos <ndevos@redhat.com>
  • Loading branch information
nixpanic authored and mergify[bot] committed Jul 23, 2021
1 parent 75dda7a commit e75d308
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion e2e/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func isRetryableAPIError(err error) bool {
}

// "etcdserver: request timed out" does not seem to match the timeout errors above
if strings.HasSuffix(err.Error(), "etcdserver: request timed out") {
if strings.Contains(err.Error(), "etcdserver: request timed out") {
return true
}

Expand Down

0 comments on commit e75d308

Please sign in to comment.