Skip to content

Commit

Permalink
connectivity: Display last assertion error on failure
Browse files Browse the repository at this point in the history
When tests have metrics expectations and those expectations are never
met, we fail the test. However, the reason for the failure is never
displayed unless debug logging is enabled. This commit fixes that by
displaying the last assertion error when the test is failed.

Signed-off-by: Sebastian Wicki <[email protected]>
  • Loading branch information
gandro authored and christarazi committed Jun 20, 2024
1 parent cf4696f commit 64c7206
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion connectivity/check/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ func (a *Action) validateMetric(ctx context.Context, node string, result Metrics
select {
case <-ctx.Done():
// Context timeout is reached, let's exit.
a.Failf("failed to collect metrics on node %s, context timeout: %s\n", node, ctx.Err())
a.Failf("failed to collect metrics on node %s. context timeout: %q, last error: %s\n", node, ctx.Err(), err)
return
case <-ticker.C:
// Ticker is delivered, let's retry.
Expand Down

0 comments on commit 64c7206

Please sign in to comment.