Files
coder/coderd
Steven Masley 76eb43a78e test(coderd): drain dormancy audit log before reset in StartWakesUpDormantWorkspace (#27541)
Closes PLAT-219 /
[coder/internal#1532](https://github.com/coder/internal/issues/1532).

The reported failure (`should have 2 item(s), but has 3`) was the stop
build's outcome audit landing after `auditor.ResetLogs()`; that path was
already deflaked by #26232 and the pre-reset drain added in #25037.

This closes the remaining hole in the same class: the dormancy update's
audit log is exported in a middleware `defer` after the API response, so
it can also land after `ResetLogs` and break the exact `len == 2`
assertion. Extend the pre-reset poll to drain the dormancy write entry
alongside the stop build entry.

Verified with `go test ./coderd -run TestWorkspaceDormant -count=5` and
`-race`.

> Generated by Coder Agents on behalf of @Emyrk.
2026-08-03 13:29:42 -05:00
..