From e5c08e27d2f560c465f293f1952991c2d537ebb3 Mon Sep 17 00:00:00 2001 From: Nikolay Martyanov Date: Tue, 3 Sep 2024 12:47:18 +0200 Subject: [PATCH] pillar/agentlog: Improve debug information in PSI-collector test. 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 --- pkg/pillar/agentlog/agentlog_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/pillar/agentlog/agentlog_test.go b/pkg/pillar/agentlog/agentlog_test.go index 843b71c54f..0585dc3c82 100644 --- a/pkg/pillar/agentlog/agentlog_test.go +++ b/pkg/pillar/agentlog/agentlog_test.go @@ -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)