You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
metrics-collection-orchestrator.cjs process.exit(1) at module load kills entire Jest run #3342
.github/scripts/workflows/metrics-collection-orchestrator.cjs calls main() at module top-level (line 258), and main() calls process.exit(1) on failure (line 207/260). Its own test file (.github/scripts/workflows/__tests__/metrics-collection-orchestrator.test.js) require()s this module directly, so importing it for testing runs the whole orchestrator for real and can call process.exit(1) mid-test-run.
In this environment (no network access to whatever the collector calls), every collection attempt fails (✅ Successful: 0/1, ❌ Failed: 1/1), triggering process.exit(1) — which kills the entire Jest process outright, not just this one test file. Any npm run test run that reaches this file never produces a final summary.
Impact
Blocks getting a reliable full-suite pass/fail count locally. Discovered while verifying PR #3341 (issue #3340) — excluding this one file was required to get a clean Test Suites: 29 failed, 177 passed, 206 total summary.
Suggested fix
Guard the module so main() only runs when the file is executed directly, not when required:
This is the standard Node pattern for CLI scripts that are also required as test fixtures, and matches how other agent scripts in this repo are already structured.
Also seen (separate, in the same investigation)
scripts/agents/issues.agent.cjs:13 — const __filename = __filename || process.argv[1]; throws SyntaxError: Identifier '__filename' has already been declared (Jest treats the file as CommonJS, where __filename is already a module-scope binding). One of the 29 suites still failing after #3341.
Activity
linear-code commentedon Sep 15, 2026
LS-4172