Skip to content

Commit

Permalink
pillar/agentlog: Improve debug information in PSI-collector test.
Browse files Browse the repository at this point in the history
Use assert.Truef to provide a detailed error message on failure. Without
the message, the error was unclear as it just indicated the boolean expression
evaluated to false.

Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
  • Loading branch information
OhmSpectator authored and milan-zededa committed Sep 4, 2024
1 parent 5b080ec commit 6258b09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/pillar/agentlog/agentlog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ func TestManageStatFileSizeTargetSizesAvgThreshold(t *testing.T) {
assert.NotEqual(t, avgSize, 0)

duration := timeEnd.Sub(timeStart)
assert.True(t, duration < 1*time.Second)
assert.Truef(t, duration < 1*time.Second, "expected duration to be less than 1 second, but got %v", duration)
t.Logf("Duration: %v", duration)
t.Logf("AvgSize: %v", avgSize)

Expand Down

0 comments on commit 6258b09

Please sign in to comment.