From 3e3d0151e6c591f8cdf418f48a0589ea71861da2 Mon Sep 17 00:00:00 2001 From: Rohit Aggarwal Date: Fri, 20 Sep 2024 14:06:22 +0530 Subject: [PATCH] Rephrasing the error message in case of continuous failure Signed-off-by: Rohit Aggarwal --- pkg/kapp/resourcesmisc/custom_waiting_resource.go | 4 ++-- test/e2e/wait_timeout_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/kapp/resourcesmisc/custom_waiting_resource.go b/pkg/kapp/resourcesmisc/custom_waiting_resource.go index 110ea5689..a4ecc4d49 100644 --- a/pkg/kapp/resourcesmisc/custom_waiting_resource.go +++ b/pkg/kapp/resourcesmisc/custom_waiting_resource.go @@ -99,8 +99,8 @@ func (s CustomWaitingResource) IsDoneApplying() DoneApplyState { isTimeOutConditionPresent = true if s.hasTimeoutOccurred(condMatcher.Timeout, s.resource.Description()) { return DoneApplyState{Done: true, Successful: false, Message: fmt.Sprintf( - "Encountered failure condition %s == %s: %s (message: %s) continuously for %s duration", - cond.Type, condMatcher.Status, cond.Reason, cond.Message, condMatcher.Timeout)} + "Continiously failed for %s with %s == %s: %s (message: %s)", + condMatcher.Timeout, cond.Type, condMatcher.Status, cond.Reason, cond.Message)} } return DoneApplyState{Done: false, Message: fmt.Sprintf( "%s: %s (message: %s)", diff --git a/test/e2e/wait_timeout_test.go b/test/e2e/wait_timeout_test.go index b6b4ccecb..969c8ec8e 100644 --- a/test/e2e/wait_timeout_test.go +++ b/test/e2e/wait_timeout_test.go @@ -103,7 +103,7 @@ waitRules: RunOpts{IntoNs: true, AllowError: true, StdinReader: strings.NewReader(fmt.Sprintf(yaml2, "nginx:200"))}) require.Error(t, err) - require.Contains(t, err.Error(), "message: containers with unready status: [nginx]) continuously for 50s duration") + require.Contains(t, err.Error(), "Continiously failed for 50s with") }) cleanUp()