test: deflake chat plan mode audit transaction failure test - #28718
Open
ethanndickson wants to merge 1 commit into
Open
test: deflake chat plan mode audit transaction failure test#28718ethanndickson wants to merge 1 commit into
ethanndickson wants to merge 1 commit into
Conversation
The test forced the next InTx call on the shared store to fail, but background services started by coderd.New (the workspace build orchestrator in particular) also call InTx, and on slow CI runners one of those calls could consume the one-shot failure flag before the PUT under test ran. Tag the plan mode instructions write transaction with a TxIdentifier and key the injected failure on it so only the code under test can trip it.
ethanndickson
marked this pull request as ready for review
August 27, 2026 15:11
mafredri
approved these changes
Aug 27, 2026
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.
TestChatPlanModeInstructions/AuditTransactionFailureRejectsWriteflaked on CI because the test store failed the nextInTxcall from any caller. Background services started bycoderd.Newshare the store, and on slow runners the workspace build orchestrator's startup transaction consumed the one-shot failure flag before the PUT under test ran, so the request succeeded and the test's expected 500 never happened. Both captured CI failures show the injected sentinel error surfacing in the orchestrator log (workspace_build_orchestrator: failed to process orchestrations error="forced chat instruction transaction failure") milliseconds before the assertion failure.Tag the plan mode instructions write transaction with a
TxIdentifierand key the injected failure on that identifier, so only the transaction under test can trip it. 160 race-enabled runs of the subtest under load pass with the fix.Closes https://linear.app/codercom/issue/CODAGT-992/flake-testchatplanmodeinstructionsaudittransactionfailurerejectswrite