| 114 | ]; |
| 115 | |
| 116 | async function runTests(attempt) { |
| 117 | if (attempt > 1) { |
| 118 | console.log(`\nRun attempt ${attempt}...\n`); |
| 119 | } |
| 120 | return await new Promise(resolve => { |
| 121 | const child = spawn(process.execPath, nodeArgs, { |
| 122 | cwd: projectRoot, |
| 123 | stdio: 'inherit', |
| 124 | env: { |
| 125 | ...process.env, |
| 126 | CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS: true, |
| 127 | CHROME_DEVTOOLS_MCP_CRASH_ON_UNCAUGHT: true, |
| 128 | CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS: true, |
| 129 | CHROME_DEVTOOLS_MCP_NO_CONFIG_DISCOVERY: true, |
| 130 | ...(process.env['RUNNER_DEBUG'] === '1' |
| 131 | ? {NODE_DEBUG: 'puppeteer:*'} |
| 132 | : {}), |
| 133 | }, |
| 134 | }); |
| 135 | |
| 136 | child.on('close', code => { |
| 137 | resolve(code); |
| 138 | }); |
| 139 | }); |
| 140 | } |
| 141 | |
| 142 | const maxAttempts = shouldRetry ? 3 : 1; |
| 143 | let exitCode = 1; |