mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: fix flake in TestExecutorAutostopTemplateDisabled (#11096)
This commit is contained in:
@ -817,7 +817,7 @@ func TestExecutorAutostopTemplateDisabled(t *testing.T) {
|
|||||||
|
|
||||||
// When: the autobuild executor ticks after the workspace setting, but before the template setting:
|
// When: the autobuild executor ticks after the workspace setting, but before the template setting:
|
||||||
go func() {
|
go func() {
|
||||||
tickCh <- workspace.LatestBuild.CreatedAt.Add(45 * time.Minute)
|
tickCh <- workspace.LatestBuild.Job.CompletedAt.Add(45 * time.Minute)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Then: nothing should happen
|
// Then: nothing should happen
|
||||||
@ -827,7 +827,7 @@ func TestExecutorAutostopTemplateDisabled(t *testing.T) {
|
|||||||
|
|
||||||
// When: the autobuild executor ticks after the template setting:
|
// When: the autobuild executor ticks after the template setting:
|
||||||
go func() {
|
go func() {
|
||||||
tickCh <- workspace.LatestBuild.CreatedAt.Add(61 * time.Minute)
|
tickCh <- workspace.LatestBuild.Job.CompletedAt.Add(61 * time.Minute)
|
||||||
close(tickCh)
|
close(tickCh)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -1131,9 +1131,9 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob)
|
|||||||
|
|
||||||
err = db.UpdateProvisionerJobWithCompleteByID(ctx, database.UpdateProvisionerJobWithCompleteByIDParams{
|
err = db.UpdateProvisionerJobWithCompleteByID(ctx, database.UpdateProvisionerJobWithCompleteByIDParams{
|
||||||
ID: jobID,
|
ID: jobID,
|
||||||
UpdatedAt: dbtime.Now(),
|
UpdatedAt: now,
|
||||||
CompletedAt: sql.NullTime{
|
CompletedAt: sql.NullTime{
|
||||||
Time: dbtime.Now(),
|
Time: now,
|
||||||
Valid: true,
|
Valid: true,
|
||||||
},
|
},
|
||||||
Error: sql.NullString{},
|
Error: sql.NullString{},
|
||||||
|
Reference in New Issue
Block a user