fix: Update database fake to check for nil time when streaming logs (#2664)

This caused a test flake seen here: https://github.com/coder/coder/runs/7056544834?check_suite_focus=true
This commit is contained in:
Kyle Carberry
2022-06-26 19:52:15 +00:00
committed by GitHub
parent 47796211d7
commit 95e854d144
+2 -2
View File
@@ -1360,10 +1360,10 @@ func (q *fakeQuerier) GetProvisionerLogsByIDBetween(_ context.Context, arg datab
if jobLog.JobID.String() != arg.JobID.String() {
continue
}
if jobLog.CreatedAt.After(arg.CreatedBefore) {
if !arg.CreatedBefore.IsZero() && jobLog.CreatedAt.After(arg.CreatedBefore) {
continue
}
if jobLog.CreatedAt.Before(arg.CreatedAfter) {
if !arg.CreatedAfter.IsZero() && jobLog.CreatedAt.Before(arg.CreatedAfter) {
continue
}
logs = append(logs, jobLog)