Skip to content

fix: don't let tests hang for an hour - #51432

Merged
dsanders11 merged 1 commit into
mainfrom
fix/esm-runfixture-timeout
May 4, 2026
Merged

dsanders11 merged 1 commit into
mainfrom
fix/esm-runfixture-timeout

Conversation

@ckerr

@ckerr ckerr commented May 1, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Fix two spec runner bugs that could cause tests to hang forever.

  1. Add a spawnAndWait() spec helper that ensures that spawned processes are cleaned up. When a caller-provided timeout is reached, the helper terminates the child process and escalates to SIGKILL if the process doesn't exit cleanly.

  2. In the "rerun failed tests" phase of script/spec-runner.js, enforce a timeout based on MOCHA_TIMEOUT.

Sample error CI log from here:

Rerunning failed test: esm renderer process nodeIntegration without context isolation should use import.meta callback handling from Node.js for Node.js modules (esm-spec.ts)
========================================
Running: /Users/runner/work/electron/electron/src/out/Default/Electron.app/Contents/MacOS/Electron electron/spec --enableRerun=3 --trace-uncaught true --enable-logging true --files /Users/runner/work/electron/electron/src/electron/spec/esm-spec.ts -g esm renderer process nodeIntegration without context isolation should use import\.meta callback handling from Node\.js for Node\.js modules
2071

Error: The action 'Run Electron Tests' has timed out after 60 minutes.

Complements #51441. This PR is "try to fix the runner to not hang on a failed test", 514441 is "try to fix the test."

Checklist

Release Notes

Notes: none.

@ckerr ckerr added semver/patch backwards-compatible bug fixes target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. labels May 1, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label May 1, 2026
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label May 2, 2026
@dsanders11
dsanders11 merged commit 0f77f20 into main May 4, 2026
88 checks passed
@dsanders11
dsanders11 deleted the fix/esm-runfixture-timeout branch May 4, 2026 13:46
@release-clerk

release-clerk Bot commented May 4, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "40-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/40-x-y and removed target/40-x-y PR should also be added to the "40-x-y" branch. labels May 4, 2026
@trop

trop Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #51466

@trop trop Bot added the in-flight/42-x-y label May 4, 2026
@trop

trop Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "41-x-y", please check out #51467

@trop trop Bot added in-flight/41-x-y merged/41-x-y PR was merged to the "41-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. and removed target/42-x-y PR should also be added to the "42-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. in-flight/41-x-y in-flight/42-x-y labels May 4, 2026
@trop

trop Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

@ckerr has manually backported this PR to "40-x-y", please check out #51687

dsanders11 pushed a commit that referenced this pull request May 19, 2026
fix: don't let tests hang for an hour (#51432)

test: set timeout limit for ESM fixture processes
@trop trop Bot added merged/40-x-y PR was merged to the "40-x-y" branch. and removed in-flight/40-x-y labels May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants