Files
coder/coderd
Michael Suchacz c8ed6f6cb2 test(coderd/x/chatd): assert the compaction debug run finishes (#31328)
Follow-up to #31087. `TestActiveServer_CompactionModelOverride` checked
only that the compaction debug run exists and records the override
model, so a regression that left the run `in_progress` still passed. The
four `summary routes to the override model` subtests now also assert
that the run's status is `completed` and that `finished_at` is set.

Mutation check, with `go test -p 2 -parallel 4 -count=1 -run
'^TestActiveServer_CompactionModelOverride$' ./coderd/x/chatd/`:
- Finalize timeout set to `time.Nanosecond` in `startCompactionDebugRun`
(`chatloop/compaction.go`), the mutant found in the #31087 review: the
old test passes all 13 subtests while it logs four `failed to finalize
debug run` warnings. With this change, the four routing subtests fail
with `expected: "completed"`, `actual: "in_progress"`.
- `finishDebugRun(err)` removed from the `generateCompactionSummary`
defer: the same four subtests fail in the same way.
- Production code restored: all 13 subtests pass, and the four routing
subtests also pass with `-count=5`.

> Xum, an AI agent, opened this PR for @ibetitsmike and wrote this
description.
2026-10-27 20:47:42 +00:00
..