Skip to content

Commit d379553

Browse files
alicodingclaude
andauthored
test: guardrail Review-queue specs on dedicated servers -- kills the cohabitation flake (#215)
* fix: guardrail e2e isolation -- dedicated per-test server, split file guardrail.spec.ts ran on the shared per-worker server pool, so its Review-queue assertions (exact pending/resolved rows, filter options, the sidebar badge count) could be contaminated by another spec cohabiting the same worker (mcp-write-cancel.spec.ts parking its own MCP approval), producing CI-only failures that never reproduced locally solo. Converts every test to the dedicated-server-per-test pattern guardrail-authoring.spec.ts already uses (own chromium.launch + spawnMillServer per test, own port pair, mkdtemp dirs, finally- stop+rm). The converted file crossed the 500-line limit, so the Review-queue tests move to a new guardrail-review.spec.ts on its own disjoint port pair. mcpTestClient.ts's connectMCPClient gains an optional explicit port for specs that aren't on the standard per-worker pool. The filterable-by-workflow test's own dedicated server starts with no run history at all, so it now also resolves a second workflow's review item itself (the filter's option list only ever contains workflows with an existing pending/resolved item) instead of relying on another test's residual state, which no longer exists once each test gets its own isolated server. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FW5GkkAG8du7tNdYLk2zSd * ci: e2e 3 -> 4 shards -- dedicated-server boots pushed two shards past the 15m cap with zero failures The recorded revisit trigger (testing.md) fired: pure cap-kills, no red tests. Shard growth is the named lever. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FW5GkkAG8du7tNdYLk2zSd --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent c0681bb commit d379553

5 files changed

Lines changed: 570 additions & 346 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,12 @@ jobs:
328328
# states for its own fail-fast: false, applied here too.
329329
fail-fast: false
330330
matrix:
331-
shardIndex: [1, 2, 3]
332-
shardTotal: [3]
331+
# 4-way since the guardrail specs moved to per-test dedicated
332+
# servers: the added boot time pushed two 3-way shards past
333+
# the 15-minute job cap with zero failing tests -- the exact
334+
# revisit trigger testing.md records for shard growth.
335+
shardIndex: [1, 2, 3, 4]
336+
shardTotal: [4]
333337
env:
334338
# Required for the same reason as build-go's ubuntu-latest entry:
335339
# playwright.config.ts's webServer builds the real server-mode

frontend/e2e/fixtures/server.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,3 +273,28 @@ export const ATLAS_SELECT_GROUP_MCP_BASE_PORT = 10080
273273
// test -- same own-server-own-ports reasoning as persistence.
274274
export const ATLAS_SESSION_SERVER_BASE_PORT = 10100
275275
export const ATLAS_SESSION_MCP_BASE_PORT = 10120
276+
277+
// guardrail.spec.ts's own dedicated pair: its Review-queue assertions
278+
// (exact pending/resolved rows, kind-filter narrowing, the sidebar
279+
// pending-count badge) must never be contaminated by another spec
280+
// cohabiting the standard per-worker pool's one shared server (e.g.
281+
// mcp-write-cancel.spec.ts parking its own MCP approval on the same
282+
// worker) -- same own-server-own-ports reasoning as guardrail-
283+
// authoring above, one class of bug applied to this file's own
284+
// Review-queue state.
285+
export const GUARDRAIL_SPEC_SERVER_BASE_PORT = 10140
286+
export const GUARDRAIL_SPEC_MCP_BASE_PORT = 10160
287+
288+
// guardrail-review.spec.ts's own dedicated pair -- guardrail.spec.ts's
289+
// Review-queue tests split into this second file once the converted
290+
// file crossed the 500-line hand-written-file limit
291+
// (.claude/rules/architecture.md); its own port pair rather than
292+
// reusing GUARDRAIL_SPEC_* above, so the two files' worker-time
293+
// lifetimes can never overlap on the same ports even though same-file/
294+
// same-worker serialization no longer makes that a correctness risk.
295+
export const GUARDRAIL_REVIEW_SERVER_BASE_PORT = 10180
296+
// Kept well clear of the server range above: 8 tests x up to 10-per-
297+
// test offsets x up to 4 workers pushes the server range itself past
298+
// 10250, so the MCP base must start beyond that or a computed server
299+
// port can land on another test's MCP listener.
300+
export const GUARDRAIL_REVIEW_MCP_BASE_PORT = 10300

0 commit comments

Comments
 (0)