Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita555022

Browse files
committed
chore: fix flake in TestExecutorAutostopTemplateDisabled
1 parente73a202 commita555022

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎coderd/autobuild/lifecycle_executor_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ func TestExecutorAutostopTemplateDisabled(t *testing.T) {
791791
tickCh=make(chan time.Time)
792792
statsCh=make(chan autobuild.Stats)
793793

794-
client=coderdtest.New(t,&coderdtest.Options{
794+
client,_=coderdtest.NewWithDatabase(t,&coderdtest.Options{
795795
AutobuildTicker:tickCh,
796796
IncludeProvisionerDaemon:true,
797797
AutobuildStats:statsCh,
@@ -817,7 +817,7 @@ func TestExecutorAutostopTemplateDisabled(t *testing.T) {
817817

818818
// When: the autobuild executor ticks after the workspace setting, but before the template setting:
819819
gofunc() {
820-
tickCh<-workspace.LatestBuild.CreatedAt.Add(45*time.Minute)
820+
tickCh<-workspace.LatestBuild.Job.CompletedAt.Add(45*time.Minute)
821821
}()
822822

823823
// Then: nothing should happen
@@ -827,7 +827,7 @@ func TestExecutorAutostopTemplateDisabled(t *testing.T) {
827827

828828
// When: the autobuild executor ticks after the template setting:
829829
gofunc() {
830-
tickCh<-workspace.LatestBuild.CreatedAt.Add(61*time.Minute)
830+
tickCh<-workspace.LatestBuild.Job.CompletedAt.Add(61*time.Minute)
831831
close(tickCh)
832832
}()
833833

‎coderd/provisionerdserver/provisionerdserver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,9 +1131,9 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob)
11311131

11321132
err=db.UpdateProvisionerJobWithCompleteByID(ctx, database.UpdateProvisionerJobWithCompleteByIDParams{
11331133
ID:jobID,
1134-
UpdatedAt:dbtime.Now(),
1134+
UpdatedAt:now,
11351135
CompletedAt: sql.NullTime{
1136-
Time:dbtime.Now(),
1136+
Time:now,
11371137
Valid:true,
11381138
},
11391139
Error: sql.NullString{},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp