Skip to content

Commit 44d7134

Browse files
Claude Agentclaude
andcommitted
fix(tests): prevent OOM and infinite hangs in incident search loop
Three layered defenses against Chrome/Node.js OOM (exit 137) and infinite hangs in findIncidentWithAlert's retry loop: 1. cy.reload() at start of each search iteration — releases browser DOM from previous iteration, preventing browser-side accumulation. 2. _quietSearch/_qLog() pattern — suppresses Cypress command logging (and DOM snapshot serialization, ~1-5 MB each) during search. Without this, ~40 commands * 15+ iterations = 600+ snapshots OOM. 3. Hard timeout safety net (35 min) — Date.now()-based kill switch that fires if cy.waitUntil's timeout breaks due to cy.reload() interfering with the Cypress command queue. Also adds warmUpForPlugin() page object method for plugin loading race condition (used by subsequent commit). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0234fa4 commit 44d7134

2 files changed

Lines changed: 137 additions & 77 deletions

File tree

web/cypress/e2e/incidents/regression/03-04.reg_e2e_firing_alerts.cy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ describe(
4242
before(() => {
4343
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
4444

45+
// Reset the search timeout so this spec gets a fresh 35-minute window
46+
incidentsPage.resetSearchTimeout();
47+
4548
cy.log('Create firing alert for testing');
4649
cy.cleanupIncidentPrometheusRules();
4750
cy.createKubePodCrashLoopingAlert().then((alertName) => {

0 commit comments

Comments
 (0)