Skip to content

Commit

Permalink
Rephrasing the error message in case of continuous failure
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Aggarwal <rohit.aggarwal@broadcom.com>
  • Loading branch information
rohitagg2020 committed Sep 20, 2024
1 parent 2f318fc commit 3e3d015
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/kapp/resourcesmisc/custom_waiting_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/wait_timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3e3d015

Please sign in to comment.