Repository navigation
feat: add per-file deadline with --file-timeout - #69
Open
gauthier-xo wants to merge 1 commit into
Open
gauthier-xo wants to merge 1 commit into
gauthier-xo wants to merge 1 commit into
Conversation
A hanging test file on node:test was never stopped, stalling the run until the CI job timeout without naming the file. A watchdog worker thread in each test child kills the process at the deadline, so it works even when the file blocks the event loop. Inband files re-arm the watchdog per file. The same option replaces the hardcoded 50x testTimeout on pure engines and keeps it as the default. Closes ExodusOSS#65
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On
node:test, a hung test file now gets killed at a deadline. The file is listed underFailed test suites:and the run moves on. Before this change, one stuck file stalled the whole run until the CI job timeout, and the log never said which file hung.New flag
--file-timeout <ms>. The default is 50xtestTimeout, the rule barebone engines already use.node:test,electron-as-node:test--file-timeoutreplaces the hardcoded 50xdeno:test,bun:test--file-timeoutexits with<engine> does not support --file-timeouttestTimeout. It's checked after jest config loads, sotestTimeoutfrom config counts.for (;;) {}can't stop it.NODE_TEST_CONTEXT=child*), not in thenode --testparent.--inspect*, so debugger sessions aren't killed.Evidence
Fixtures are in
tests/integration/file-timeout/. The run below uses--jest --testTimeout 900 --file-timeout 1000.blocking.jsandtoplevel-await.jshang forever. The run never finishes.tests/cli/file-timeout.test.jshas 8 tests. They spawnbin/index.jsand check:--file-timeoutoverrides the deadline onnode:pure(pure path, same as barebone)0,-1,1.5,abc, and a value not abovetestTimeoutall exit 1 with an error--engine deno:test --file-timeoutexits 1CI=1 pnpm test:allpasses on Node 22.22 (148/144/147/70 suites across modes)electron-as-node:testis covered only by CItests/cli/is added to thetest:_bundleignore list because bundled engines can't spawn processes.Merge Danger
Door: two-way
Blast Radius: CI runs
node:testfile that legitimately runs longer than 50xtestTimeout(250s by default) now fails. Before, it passed. Raise the limit with--file-timeout.reporter.jsfortest:stderr. TheFATALline always names the right file.Closes #65