Skip to content

Commit 10f40d1

Browse files
authored
Give the cap-eviction scenario an idle window it can cross the cap in (#2395)
The scenario opens sessions one at a time and needs cap + 1 (25) resident at once, but each session idles out MCP_SESSION_TIMEOUT_MS after it opened. At 3s, 25 opens took the whole window on a CI runner (80-125ms each). When they ran over, early sessions idled out as new ones opened, the cap was never crossed, and the scenario timed out. Raise the e2e idle timeout to 8s in CI and the e2e default, and document the constraint next to the cap.
1 parent bfc9152 commit 10f40d1

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ jobs:
310310
- name: Run cloud shard
311311
if: matrix.target == 'cloud'
312312
env:
313-
MCP_SESSION_TIMEOUT_MS: "3000"
313+
# Long enough for the cap-eviction scenario to hold more sessions
314+
# resident than the e2e cap (see e2e/setup/resident-runtime-cap.ts).
315+
MCP_SESSION_TIMEOUT_MS: "8000"
314316
# Still 18x shorter than production, but long enough for a cold Vite
315317
# resume route to compile under a fully loaded CI runner.
316318
MCP_PAUSED_SESSION_IDLE_TIMEOUT_MS: "30000"

‎e2e/setup/mcp-session-timeouts.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
const DEFAULT_E2E_MCP_SESSION_TIMEOUT_MS = 3_000;
1+
// Expiry coverage waits on this, so it stays far below production's five
2+
// minutes. Its floor is the cap-eviction scenario: it opens sessions one at a
3+
// time and needs cap + 1 of them resident at once, so that many opens must
4+
// finish inside this window (see resident-runtime-cap.ts).
5+
const DEFAULT_E2E_MCP_SESSION_TIMEOUT_MS = 8_000;
26
// Keep expiry coverage fast while leaving enough room for a cold browser route
37
// to compile under CI contention. Production allows nine minutes.
48
const DEFAULT_E2E_MCP_PAUSED_SESSION_IDLE_TIMEOUT_MS = 30_000;

‎e2e/setup/resident-runtime-cap.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,12 @@
1818
// expect), that is not a correctness bug — eviction is designed to be
1919
// transparent, restoring on the next call — but it means this constant needs
2020
// to grow: raise it here, never by special-casing a scenario against it.
21+
//
22+
// The idle timeout bounds it from the other side. The scenario opens sessions
23+
// one at a time while each one idles out MCP_SESSION_TIMEOUT_MS after it opened,
24+
// so cap + 1 opens must finish inside that window or residency never reaches
25+
// the cap. An open costs about 80-125ms on a CI runner, and more on slower
26+
// machines: 25 opens took the whole of the old 3s window, and the scenario
27+
// failed whenever they ran over. Growing this constant means growing that
28+
// timeout too (mcp-session-timeouts.ts and the cloud shard env in ci.yml).
2129
export const E2E_MCP_RESIDENT_RUNTIME_SOFT_CAP = 24;

0 commit comments

Comments
 (0)