René's URL Explorer Experiment


Title: test_runner: flush report stream before force exit by Navaneethp007 · Pull Request #64875 · nodejs/node · GitHub

Open Graph Title: test_runner: flush report stream before force exit by Navaneethp007 · Pull Request #64875 · nodejs/node

X Title: test_runner: flush report stream before force exit by Navaneethp007 · Pull Request #64875 · nodejs/node

Description: Summary Fixes: #64833 When --test-force-exit is used together with process isolation, each test file runs in a child process that streams its results back to the test runner's parent process over its stdout, which is a pipe. Writes to a pipe are asynchronous, so the process.exit() issued on force exit could quit the process while report frames were still buffered in the pipe. The trailing test:pass / test:fail events were silently dropped, yet the process still exited with code 0 — so verdicts disappeared with no error and no failing exit status. The flush loop added in #55099 only drains reporter destinations that expose a close() method (for example file destinations). A pipe has no close(), so that branch resolved immediately without flushing anything, leaving the async pipe writes to be truncated by the exit. This is why the loss only reproduces where the pipe is non-blocking (Linux); on Windows named pipes, TTYs, and file destinations the writes are effectively blocking, so the output looked clean. Fix In the force-exit path, for a destination that has no close() (the child-process pipe case), switch the underlying handle to blocking with _handle.setBlocking(true) — the same idiom Node already uses before exit in lib/net.js and lib/tty.js — then end() the stream and await it, so any queued bytes are flushed to the OS before the process exits. Existing file destinations continue to use the close() path unchanged. Additionally, yield once via setImmediate after tearing down the harness and before process.exit(), so report events that have already arrived on the parent's readable side get dispatched to the reporters before exit. This part follows the approach proposed in #64857 by @NeverBetterEnough; on its own a single tick is probabilistic under concurrency and did not fully eliminate the loss in my testing, but combined with the blocking flush the result is deterministic. Test Adds test/parallel/test-runner-force-exit-no-verdict-loss.js, which generates 12 files of 1000 tests each and runs them with --test-force-exit at --test-concurrency=16, then asserts that all 12000 verdicts are present in the reporter output and the process exits 0. The test fails on main (e.g. 11532 !== 12000) and passes with this change. Existing test-runner-force-exit* tests, including the one from #55099, continue to pass.

Open Graph Description: Summary Fixes: #64833 When --test-force-exit is used together with process isolation, each test file runs in a child process that streams its results back to the test runner's parent process ov...

X Description: Summary Fixes: #64833 When --test-force-exit is used together with process isolation, each test file runs in a child process that streams its results back to the test runner's parent proces...

Opengraph URL: https://github.com/nodejs/node/pull/64875

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:d0406d0b-1ab0-d688-7d25-399d8f324e0a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC212:28029D:192087:22D209:6AEDAB7E
html-safe-noncedb2b1162b8cbea9e19aaa599472e947f376c085089d0f49867b0b562571ae7eb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjEyOjI4MDI5RDoxOTIwODc6MjJEMjA5OjZBRURBQjdFIiwidmlzaXRvcl9pZCI6Ijc3OTM4MjA2MjQwMzg1MDUzNDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac8110d0cc4ccf23d8afb6778756b59a249e59bd0f207321f4a7c06c094bf63bab
hovercard-subject-tagpull_request:4178561715
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
twitter:imagehttps://avatars.githubusercontent.com/u/76899241?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/76899241?s=400&v=4
og:image:altSummary Fixes: #64833 When --test-force-exit is used together with process isolation, each test file runs in a child process that streams its results back to the test runner's parent process ov...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9f51e3b6c7a190e426e641ae15acbc58dd1ac2003e96b58879bbc298e213dbf3
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7060660810b587033ea861b8aa67beb72c8e6542
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F64875%2Fcommits%2F6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F64875%2Fcommits%2F6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fcommits&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
Reloadhttps://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
Reloadhttps://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues654 (654)https://github.com/nodejs/node/issues
Pull requests664 (664)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
Navaneethp007https://github.com/Navaneethp007
nodejs:mainhttps://github.com/nodejs/node/tree/main
Navaneethp007:fix-test-runner-force-exit-verdict-losshttps://github.com/Navaneethp007/node/tree/fix-test-runner-force-exit-verdict-loss
Conversation 3 https://github.com/nodejs/node/pull/64875
Commits 2 https://github.com/nodejs/node/pull/64875/commits
Checks 0 https://github.com/nodejs/node/pull/64875/checks
Files changed https://github.com/nodejs/node/pull/64875/files
Please reload this pagehttps://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
test_runner: flush report stream before force exit https://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87#top
Show all changes 2 commits https://github.com/nodejs/node/pull/64875/files
75270c7 test_runner: flush report stream before force exit Navaneethp007 Jul 31, 2026 https://github.com/nodejs/node/pull/64875/commits/75270c7f12c5438d6cc1b9337e0d0fe8df3a89eb
6a7d3c4 test_runner: bound the force-exit flush wait Navaneethp007 Aug 16, 2026 https://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
Clear filters https://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
Please reload this pagehttps://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
Please reload this pagehttps://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
Prev https://github.com/nodejs/node/pull/64875/commits/75270c7f12c5438d6cc1b9337e0d0fe8df3a89eb
Please reload this pagehttps://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87
https://github.com/Navaneethp007
Navaneethp007https://github.com/nodejs/node/commits?author=Navaneethp007
lib/internal/test_runner/test.jshttps://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87#diff-42583d1c2fb89ce93a6c2922840a13f8026995468ffe8b0ac8319d1749de6acb
View file https://github.com/nodejs/node/blob/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87/lib/internal/test_runner/test.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/64875/commits/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87#diff-42583d1c2fb89ce93a6c2922840a13f8026995468ffe8b0ac8319d1749de6acb
https://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87#diff-42583d1c2fb89ce93a6c2922840a13f8026995468ffe8b0ac8319d1749de6acb
https://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87#diff-42583d1c2fb89ce93a6c2922840a13f8026995468ffe8b0ac8319d1749de6acb
https://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87#diff-42583d1c2fb89ce93a6c2922840a13f8026995468ffe8b0ac8319d1749de6acb
https://github.com/nodejs/node/pull/64875/commits/6a7d3c42fe032ebd0d8450eb0eb228cccaacfa87#diff-42583d1c2fb89ce93a6c2922840a13f8026995468ffe8b0ac8319d1749de6acb
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.