From 806683d7271838b0893f3186917ec846699e554b Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Mon, 5 Oct 2026 18:19:36 +0700 Subject: [PATCH] test(cli): take the upload time bound before reading the upload TestOSRecoverySkipSurvivesDebugTruncation passed time.Now() as the argument after readLogReader, and Go evaluates arguments left to right, so the lower bound was taken after the upload header was rendered. The header check failed whenever a second boundary fell between the two: header time = 11:13:44, want a time between 11:13:45.007 and now Take the bound first, as the other splitUpload callers do. --- cmd/cli/recovery_skip_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/cli/recovery_skip_test.go b/cmd/cli/recovery_skip_test.go index 69cdc5d..f5a8ad7 100644 --- a/cmd/cli/recovery_skip_test.go +++ b/cmd/cli/recovery_skip_test.go @@ -137,7 +137,11 @@ func TestOSRecoverySkipSurvivesDebugTruncation(t *testing.T) { for range 40 { mainLog.Load().Debug().Msg(strings.Repeat("debug filler", 20)) } - debugPart, journalPart := splitUpload(t, readLogReader(t, p, false), time.Now()) + // Taken before the read renders the upload header: as an argument after + // readLogReader it would be evaluated later, and fail whenever a second + // boundary falls between the two. + start := time.Now() + debugPart, journalPart := splitUpload(t, readLogReader(t, p, false), start) if strings.Contains(string(debugPart), recoverySkipMessage) { t.Fatal("fixture did not truncate the skip from debug") }