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

Commit67553a7

Browse files
chore: fix TestWorkspaceAutobuild/NextStartAtIsValid flake (#15772)
Fixescoder/internal#238It appears we haven't got quartz piped through to enough of Coder forthe test to work as I had expected. Using the current time should besufficient for this test.
1 parent069655a commit67553a7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

‎enterprise/coderd/workspaces_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,9 +1117,7 @@ func TestWorkspaceAutobuild(t *testing.T) {
11171117
clock=quartz.NewMock(t)
11181118
)
11191119

1120-
// Set the clock to 8AM Monday, 1st January, 2024 to keep
1121-
// this test deterministic.
1122-
clock.Set(time.Date(2024,1,1,8,0,0,0,time.UTC))
1120+
clock.Set(dbtime.Now())
11231121

11241122
logger:=slogtest.Make(t,&slogtest.Options{IgnoreErrors:true}).Leveled(slog.LevelDebug)
11251123
client,user:=coderdenttest.New(t,&coderdenttest.Options{
@@ -1129,7 +1127,7 @@ func TestWorkspaceAutobuild(t *testing.T) {
11291127
AutobuildStats:statsCh,
11301128
Logger:&logger,
11311129
Clock:clock,
1132-
TemplateScheduleStore:schedule.NewEnterpriseTemplateScheduleStore(agplUserQuietHoursScheduleStore(),notifications.NewNoopEnqueuer(),logger,nil),
1130+
TemplateScheduleStore:schedule.NewEnterpriseTemplateScheduleStore(agplUserQuietHoursScheduleStore(),notifications.NewNoopEnqueuer(),logger,clock),
11331131
},
11341132
LicenseOptions:&coderdenttest.LicenseOptions{
11351133
Features: license.Features{codersdk.FeatureAdvancedTemplateScheduling:1},
@@ -1185,7 +1183,7 @@ func TestWorkspaceAutobuild(t *testing.T) {
11851183
}
11861184

11871185
// Ensure that there is a valid next start at and that is is after
1188-
// thepreivous start.
1186+
// theprevious start.
11891187
require.NotNil(t,ws.NextStartAt)
11901188
require.Greater(t,*ws.NextStartAt,next)
11911189

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp