From 5c016b4b9443e81543236ba93d7d13a93ab87c89 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 19 Jul 2021 10:48:06 +0200 Subject: [PATCH] e2e: retry on "connect: connection refused" errors Sometimes there are failures in the e2e suite when connecting to the etcdserver fails. The following error was caught: INFO: Error getting pvc "rbd-pvc" in namespace "rbd-1318": Get "https://192.168.39.222:8443/api/v1/namespaces/rbd-1318/persistentvolumeclaims/rbd-pvc": dial tcp 192.168.39.222:8443: connect: connection refused FAIL: failed to create PVC with error failed to get pvc: Get "https://192.168.39.222:8443/api/v1/namespaces/rbd-1318/persistentvolumeclaims/rbd-pvc": dial tcp 192.168.39.222:8443: connect: connection refused If etcdserver was only briefly unavailable, one or more retries might be sufficient to have the test pass. Signed-off-by: Niels de Vos --- e2e/errors.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/e2e/errors.go b/e2e/errors.go index b398cfba0..ca402082a 100644 --- a/e2e/errors.go +++ b/e2e/errors.go @@ -26,7 +26,8 @@ import ( func isRetryableAPIError(err error) bool { // These errors may indicate a transient error that we can retry in tests. if apierrors.IsInternalError(err) || apierrors.IsTimeout(err) || apierrors.IsServerTimeout(err) || - apierrors.IsTooManyRequests(err) || utilnet.IsProbableEOF(err) || utilnet.IsConnectionReset(err) { + apierrors.IsTooManyRequests(err) || utilnet.IsProbableEOF(err) || utilnet.IsConnectionReset(err) || + utilnet.IsConnectionRefused(err) { return true }