Summary
The GitHub Actions test job can remain in npm test for roughly six hours and then be cancelled, even though the test suite itself can complete successfully in under a minute.
Observed behavior
The hang is not Ubuntu-specific. Recent CI history shows the same long-running npm test behavior on multiple runners, with successful runs on the other platforms.
Examples:
For the cancelled jobs, the logs end with patterns such as:
The operation was canceled.
Cleaning up orphan processes
Terminate orphan process: pid (...) (npm test)
Terminate orphan process: pid (...) (sh)
Terminate orphan process: pid (...) (MainThread)
...
On macOS, the cleanup also shows orphan node processes being terminated.
The runner therefore still had the npm test process and child processes alive when the job was cancelled.
By comparison, a successful Ubuntu run completed:
tests 441
pass 441
fail 0
cancelled 0
skipped 0
duration_ms 38389.531839
Reproduction / characteristics
The CI workflow runs the same test command on Ubuntu, macOS, and Windows:
npm run build && node --test "tests/**/*.test.mjs"
The test suite contains multiple E2E tests that spawn the CLI as child Node processes and create local HTTP servers.
The hang appears to be intermittent and platform-dependent in manifestation, but cross-platform in scope: different runs can hang on different runners, while the other runners complete normally.
This points more toward a test-process lifecycle / resource cleanup issue (for example lingering child processes, servers, sockets, or timers) than an Ubuntu-only runner problem.
Expected behavior
After all tests have completed, the npm test process should terminate normally and the GitHub Actions job should finish promptly on every supported runner.
Impact
This can consume the full GitHub Actions job execution window before the run is cancelled, making CI appear hung and significantly delaying feedback.
Environment
- GitHub Actions
ubuntu-latest, macos-latest, and windows-latest
- Node.js 24 (configured by the workflow)
node:test
- 441-test suite on the observed successful run
Summary
The GitHub Actions test job can remain in
npm testfor roughly six hours and then be cancelled, even though the test suite itself can complete successfully in under a minute.Observed behavior
The hang is not Ubuntu-specific. Recent CI history shows the same long-running
npm testbehavior on multiple runners, with successful runs on the other platforms.Examples:
For the cancelled jobs, the logs end with patterns such as:
On macOS, the cleanup also shows orphan
nodeprocesses being terminated.The runner therefore still had the
npm testprocess and child processes alive when the job was cancelled.By comparison, a successful Ubuntu run completed:
Reproduction / characteristics
The CI workflow runs the same test command on Ubuntu, macOS, and Windows:
The test suite contains multiple E2E tests that spawn the CLI as child Node processes and create local HTTP servers.
The hang appears to be intermittent and platform-dependent in manifestation, but cross-platform in scope: different runs can hang on different runners, while the other runners complete normally.
This points more toward a test-process lifecycle / resource cleanup issue (for example lingering child processes, servers, sockets, or timers) than an Ubuntu-only runner problem.
Expected behavior
After all tests have completed, the
npm testprocess should terminate normally and the GitHub Actions job should finish promptly on every supported runner.Impact
This can consume the full GitHub Actions job execution window before the run is cancelled, making CI appear hung and significantly delaying feedback.
Environment
ubuntu-latest,macos-latest, andwindows-latestnode:test