Skip to content

test: deflake chat plan mode audit transaction failure test - #28718

Open
ethanndickson wants to merge 1 commit into
mainfrom
chat-plan-mode-bw7e
Open

test: deflake chat plan mode audit transaction failure test#28718
ethanndickson wants to merge 1 commit into
mainfrom
chat-plan-mode-bw7e

Conversation

@ethanndickson

Copy link
Copy Markdown
Member

TestChatPlanModeInstructions/AuditTransactionFailureRejectsWrite flaked on CI because the test store failed the next InTx call from any caller. Background services started by coderd.New share 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 TxIdentifier and 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

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.
@linear-code

linear-code Bot commented Aug 27, 2026

Copy link
Copy Markdown

CODAGT-992

@ethanndickson
ethanndickson marked this pull request as ready for review August 27, 2026 15:11
@ethanndickson ethanndickson changed the title fix(coderd): deflake chat plan mode audit transaction failure test test: deflake chat plan mode audit transaction failure test Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants