mirror of
https://github.com/coder/coder.git
synced 2026-06-06 14:38:23 +00:00
d1f2dec4ff
`TestExecutorAutostartOK` and its sibling positive autostart tests compute the autobuild tick from `sched.Next(workspace.LatestBuild.CreatedAt)`, but the server persists `next_start_at` from the build's completion time. When build creation and completion straddle the schedule's next fire time, the persisted value advances past the test's tick, the executor's eligibility query (`next_start_at <= tick`) drops the workspace, and the test fails with an empty transitions map. This surfaced in flaky test runs. Add `coderdtest.NextAutostartTick(t, workspace)` which returns `*workspace.NextStartAt`, and use it across the affected positive autostart paths in `coderd/autobuild`, `coderd`, and `enterprise/coderd`. Generated with assistance from Coder Agents.