Repository navigation
test(coderd): table the chatstate queue and invalid-state endpoint tests - #30941
Draft
ibetitsmike wants to merge 2 commits into
Draft
ibetitsmike wants to merge 2 commits into
ibetitsmike wants to merge 2 commits into
Conversation
…ndpoint tests Twelve tests in exp_chats_chatstate_test.go each started their own coderd server to make one request. Merge them into three tests that share a server: TestChatQueueEndpointErrors for queue delete and promote, TestPatchChatChildArchive for the family archive rules, and TestInvalidChatStateEndpoints for the shared invalid-state response and reconcile. Every case stays a parallel subtest with its own chats.
The child archive test merge moves to its own stacked PR, so this layer only tables the queue and invalid-state endpoint tests.
ibetitsmike
added this pull request to stack #30957
October 18, 2026 15:46
Collaborator
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces nine copy-pasted endpoint tests in
coderd/exp_chats_chatstate_test.gowith two table tests that each share one coderd server.TestChatQueueEndpointErrorsturns the four queue delete and promote tests into rows.TestInvalidChatStateEndpointsturns the two shared invalid-state response tests into rows and holds the three reconcile cases as subtests. Every old case stays a parallel subtest with its own chat, and the file starts 13 coderd servers instead of 20.Why it is safe: each subtest sends the same request and makes the same assertions as the test it replaces. With the old tests compiled back in through
go test -overlay, each of 10 production mutants failed exactly the old test that guarded the line and the subtest that replaces it:MissingorEmptyQueuecasewriteChatInvalidState(2 mutants)ReturnsSharedResponsecaseReconcileNotInvalidReturnsConflictlast_error(2 mutants)ReconcileSucceedsReconcileNotFoundReview focus: subtests now share a server, user, and model config. Each subtest creates its own chat and reads only that chat, and
withChatWorkerDisabledstays on, so no worker moves a chat between steps.Timing (
-count=1 -v -p 4 -parallel 4, median of 5 paired runs on a shared host): the nine old tests took 3.8 s summed. The two new tests take 0.9 s.Validation:
go test ./coderd -run '^(TestChatQueueEndpointErrors|TestInvalidChatStateEndpoints)$' -count=10: pass-race -count=3: passgo vet ./coderdandgolangci-lint run ./coderd/...: clean; the pre-commit hook passedStack: these two PRs share coderd servers across the copy-pasted chatstate endpoint tests.