| 82 | } |
| 83 | |
| 84 | async function runTests(attempt) { |
| 85 | if (attempt > 1) { |
| 86 | console.log(`\nRun attempt ${attempt}...\n`); |
| 87 | } |
| 88 | return new Promise(resolve => { |
| 89 | const child = spawn('node', nodeArgs, { |
| 90 | stdio: 'inherit', |
| 91 | env: { |
| 92 | ...process.env, |
| 93 | CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS: true, |
| 94 | CHROME_DEVTOOLS_MCP_CRASH_ON_UNCAUGHT: true, |
| 95 | CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS: true, |
| 96 | ...(process.env['RUNNER_DEBUG'] === '1' ? {DEBUG: 'puppeteer:*'} : {}), |
| 97 | }, |
| 98 | }); |
| 99 | |
| 100 | child.on('close', code => { |
| 101 | resolve(code); |
| 102 | }); |
| 103 | }); |
| 104 | } |
| 105 | |
| 106 | const maxAttempts = shouldRetry ? 3 : 1; |
| 107 | let exitCode = 1; |