Skip to content

Commit b9908cf

Browse files
committed
remove sched
1 parent 9e95207 commit b9908cf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

coderd/autobuild/lifecycle_executor_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,6 @@ func TestExecuteAutostopSuspendedUser(t *testing.T) {
568568

569569
var (
570570
ctx = testutil.Context(t, testutil.WaitShort)
571-
sched = mustSchedule(t, "CRON_TZ=UTC 0 * * * *")
572571
tickCh = make(chan time.Time)
573572
statsCh = make(chan autobuild.Stats)
574573
client = coderdtest.New(t, &coderdtest.Options{
@@ -583,9 +582,7 @@ func TestExecuteAutostopSuspendedUser(t *testing.T) {
583582
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
584583
template := coderdtest.CreateTemplate(t, client, admin.OrganizationID, version.ID)
585584
userClient, user := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
586-
workspace := coderdtest.CreateWorkspace(t, userClient, admin.OrganizationID, template.ID, func(cwr *codersdk.CreateWorkspaceRequest) {
587-
cwr.AutostartSchedule = ptr.Ref(sched.String())
588-
})
585+
workspace := coderdtest.CreateWorkspace(t, userClient, admin.OrganizationID, template.ID)
589586
coderdtest.AwaitWorkspaceBuildJobCompleted(t, userClient, workspace.LatestBuild.ID)
590587

591588
// Given: workspace is running, and the user is suspended.
@@ -596,7 +593,7 @@ func TestExecuteAutostopSuspendedUser(t *testing.T) {
596593

597594
// When: the autobuild executor ticks after the scheduled time
598595
go func() {
599-
tickCh <- sched.Next(workspace.LatestBuild.CreatedAt)
596+
tickCh <- time.Unix(0, 0) // the exact time is not important
600597
close(tickCh)
601598
}()
602599

0 commit comments

Comments
 (0)