mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-10-12 01:58:46 +02:00
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.
This commit is contained in:
1 file changed
+5
-1
@@ -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")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user