chore: fix flake in TestExecutorAutostopTemplateDisabled (#11096)

This commit is contained in:
Jon Ayers 2023-12-08 03:02:54 -06:00 committed by GitHub
parent b4ca1d6579
commit 02696f2df9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -817,7 +817,7 @@ func TestExecutorAutostopTemplateDisabled(t *testing.T) {
// When: the autobuild executor ticks after the workspace setting, but before the template setting:
go func() {
tickCh <- workspace.LatestBuild.CreatedAt.Add(45 * time.Minute)
tickCh <- workspace.LatestBuild.Job.CompletedAt.Add(45 * time.Minute)
}()
// Then: nothing should happen
@ -827,7 +827,7 @@ func TestExecutorAutostopTemplateDisabled(t *testing.T) {
// When: the autobuild executor ticks after the template setting:
go func() {
tickCh <- workspace.LatestBuild.CreatedAt.Add(61 * time.Minute)
tickCh <- workspace.LatestBuild.Job.CompletedAt.Add(61 * time.Minute)
close(tickCh)
}()

View File

@ -1131,9 +1131,9 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob)
err = db.UpdateProvisionerJobWithCompleteByID(ctx, database.UpdateProvisionerJobWithCompleteByIDParams{
ID: jobID,
UpdatedAt: dbtime.Now(),
UpdatedAt: now,
CompletedAt: sql.NullTime{
Time: dbtime.Now(),
Time: now,
Valid: true,
},
Error: sql.NullString{},