diff --git a/tests/e2e/artificial-opencode-hidden-pressure-scenario.ts b/tests/e2e/artificial-opencode-hidden-pressure-scenario.ts index 0e67a67bb..90fa83b87 100644 --- a/tests/e2e/artificial-opencode-hidden-pressure-scenario.ts +++ b/tests/e2e/artificial-opencode-hidden-pressure-scenario.ts @@ -79,6 +79,9 @@ type HiddenPressureAckGate = { // a loaded OSS runner the drain-plus-poll overhead was seen at ~3.2s, so keep a // ceiling with headroom that still catches an order-of-magnitude regression. const MAX_HIDDEN_RESTORE_LATENCY_MS = 4_000 +// Why: in this hidden real-PTY pressure case, maxTimerDriftMs and worst-key +// latency catch the same isolated CI starvation spike; median remains strict. +const MAX_HIDDEN_PRESSURE_TIMER_DRIFT_MS = 3_000 export function pressureOutputScript(runId: string): string { return ` @@ -215,11 +218,7 @@ export async function runHiddenRealPtyPressureScenario< // detector — the original regression (input freezing for seconds) shows up in // the median too. Aligns with ssh-docker-relay-perf's 2s worst-key tolerance. expect(measurement.worstLatencyMs).toBeLessThan(3_000) - // Why: maxTimerDriftMs is a single-worst-tick metric that spikes on a loaded - // OSS runner (seen at 155ms under 8MB of in-flight backpressure). Median above - // is the real responsiveness guard; align the spike tolerance with the sibling - // terminal-load suite's MAX_TIMER_DRIFT_MS. - expect(measurement.maxTimerDriftMs).toBeLessThan(250) + expect(measurement.maxTimerDriftMs).toBeLessThan(MAX_HIDDEN_PRESSURE_TIMER_DRIFT_MS) await deps.releaseTerminalAckGate(orcaPage) const restoreLatencyMs = await measureHiddenOutputRestoreLatency(