Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95e854d

Browse files
authored
fix: Update database fake to check for nil time when streaming logs (coder#2664)
This caused a test flake seen here: https://github.com/coder/coder/runs/7056544834?check_suite_focus=true
1 parent 4779621 commit 95e854d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coderd/database/databasefake/databasefake.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1360,10 +1360,10 @@ func (q *fakeQuerier) GetProvisionerLogsByIDBetween(_ context.Context, arg datab
13601360
if jobLog.JobID.String() != arg.JobID.String() {
13611361
continue
13621362
}
1363-
if jobLog.CreatedAt.After(arg.CreatedBefore) {
1363+
if !arg.CreatedBefore.IsZero() && jobLog.CreatedAt.After(arg.CreatedBefore) {
13641364
continue
13651365
}
1366-
if jobLog.CreatedAt.Before(arg.CreatedAfter) {
1366+
if !arg.CreatedAfter.IsZero() && jobLog.CreatedAt.Before(arg.CreatedAfter) {
13671367
continue
13681368
}
13691369
logs = append(logs, jobLog)

0 commit comments

Comments
 (0)