René's URL Explorer Experiment


Title: test: fix flaky test-worker-message-port-transfer-filehandle test by himself65 · Pull Request #59158 · nodejs/node · GitHub

Open Graph Title: test: fix flaky test-worker-message-port-transfer-filehandle test by himself65 · Pull Request #59158 · nodejs/node

X Title: test: fix flaky test-worker-message-port-transfer-filehandle test by himself65 · Pull Request #59158 · nodejs/node

Description: Fixes: #59145 Wrap all script into setInterval and you will see the error 'use strict'; const common = require('../common'); const assert = require('assert'); const fs = require('fs').promises; const vm = require('vm'); const { MessageChannel, moveMessagePortToContext } = require('worker_threads'); const { once } = require('events'); setInterval(async () => { (async function() { const fh = await fs.open(__filename); const { port1, port2 } = new MessageChannel(); assert.throws(() => { port1.postMessage(fh); }, { constructor: DOMException, name: 'DataCloneError', code: 25, }); // Check that transferring FileHandle instances works. assert.notStrictEqual(fh.fd, -1); port1.postMessage(fh, [ fh ]); assert.strictEqual(fh.fd, -1); const [ fh2 ] = await once(port2, 'message'); assert.strictEqual(Object.getPrototypeOf(fh2), Object.getPrototypeOf(fh)); assert.deepStrictEqual(await fh2.readFile(), await fs.readFile(__filename)); await fh2.close(); await assert.rejects(() => fh.readFile(), { code: 'EBADF' }); })().then(common.mustCall()); (async function() { // Check that there is no crash if the message is never read. const fh = await fs.open(__filename); const { port1 } = new MessageChannel(); assert.notStrictEqual(fh.fd, -1); port1.postMessage(fh, [ fh ]); assert.strictEqual(fh.fd, -1); })().then(common.mustCall()); (async function() { // Check that in the case of a context mismatch the message is discarded. const fh = await fs.open(__filename); const { port1, port2 } = new MessageChannel(); const ctx = vm.createContext(); const port2moved = moveMessagePortToContext(port2, ctx); port2moved.onmessage = common.mustCall((msgEvent) => { assert.strictEqual(msgEvent.data, 'second message'); port1.close(); }); // TODO(addaleax): Switch this to a 'messageerror' event once MessagePort // implements EventTarget fully and in a cross-context manner. port2moved.onmessageerror = common.mustCall((event) => { assert.strictEqual(event.data.code, 'ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE'); }); port2moved.start(); assert.notStrictEqual(fh.fd, -1); port1.postMessage(fh, [ fh ]); assert.strictEqual(fh.fd, -1); port1.postMessage('second message'); })().then(common.mustCall()); (async function() { // Check that a FileHandle with a read in progress cannot be transferred. const fh = await fs.open(__filename); const { port1 } = new MessageChannel(); const readPromise = fh.readFile(); assert.throws(() => { port1.postMessage(fh, [fh]); }, { message: 'Cannot transfer FileHandle while in use', name: 'DataCloneError' }); assert.deepStrictEqual(await readPromise, await fs.readFile(__filename)); // await fh.close(); })().then(common.mustCall()); (async function() { // Check that filehandles with a close in progress cannot be transferred. const fh = await fs.open(__filename); const { port1 } = new MessageChannel(); const closePromise = fh.close(); assert.throws(() => { port1.postMessage(fh, [fh]); }, { message: 'Cannot transfer FileHandle while in use', name: 'DataCloneError' }); await closePromise; })().then(common.mustCall()); }, 10)

Open Graph Description: Fixes: #59145 Wrap all script into setInterval and you will see the error 'use strict'; const common = require('../common'); const assert = require('assert'); const fs = req...

X Description: Fixes: #59145 Wrap all script into setInterval and you will see the error 'use strict'; const common = require('../common'); const assert = require('assert&a...

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

X: @github

direct link

Domain: redirect.github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:38742d4b-1a11-b216-51ec-affecc29aba9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB258:2EFA45:7BF2E8:B0967B:6A4BD36D
html-safe-nonce10cc8440320d02aa0a9483770b0d2b1b52ee404f0adbf70d202cf4f5399722de
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjU4OjJFRkE0NTo3QkYyRTg6QjA5NjdCOjZBNEJEMzZEIiwidmlzaXRvcl9pZCI6IjQwNTEyNTA0MDUwNjkwMTc5NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacdd32afcea27c1d9ffb7032f46fbe34db78beb9b88ba56b804724f3a2ddbbff7a
hovercard-subject-tagpull_request:2684595999
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/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/59158/files
twitter:imagehttps://avatars.githubusercontent.com/u/14026360?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/14026360?s=400&v=4
og:image:altFixes: #59145 Wrap all script into setInterval and you will see the error 'use strict'; const common = require('../common'); const assert = require('assert'); const fs = req...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9df996be9551ac02247d09a2f7f64ece66c35ca28885d346e98fdfda9cdaa37b
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-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb71208a1c9ec7ccf364087569d0551f665dda674
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://redirect.github.com/nodejs/node/pull/59158/files#start-of-content
https://redirect.github.com/
Sign in https://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F59158%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F59158%2Ffiles
Sign up https://redirect.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%2Ffiles&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://redirect.github.com/nodejs/node/pull/59158/files
Reloadhttps://redirect.github.com/nodejs/node/pull/59158/files
Reloadhttps://redirect.github.com/nodejs/node/pull/59158/files
Please reload this pagehttps://redirect.github.com/nodejs/node/pull/59158/files
nodejs https://redirect.github.com/nodejs
nodehttps://redirect.github.com/nodejs/node
Please reload this pagehttps://redirect.github.com/nodejs/node/pull/59158/files
Notifications https://redirect.github.com/login?return_to=%2Fnodejs%2Fnode
Fork 36k https://redirect.github.com/login?return_to=%2Fnodejs%2Fnode
Star 118k https://redirect.github.com/login?return_to=%2Fnodejs%2Fnode
Code https://redirect.github.com/nodejs/node
Issues 1.4k https://redirect.github.com/nodejs/node/issues
Pull requests 965 https://redirect.github.com/nodejs/node/pulls
Actions https://redirect.github.com/nodejs/node/actions
Projects https://redirect.github.com/nodejs/node/projects
Security and quality 0 https://redirect.github.com/nodejs/node/security
Insights https://redirect.github.com/nodejs/node/pulse
Code https://redirect.github.com/nodejs/node
Issues https://redirect.github.com/nodejs/node/issues
Pull requests https://redirect.github.com/nodejs/node/pulls
Actions https://redirect.github.com/nodejs/node/actions
Projects https://redirect.github.com/nodejs/node/projects
Security and quality https://redirect.github.com/nodejs/node/security
Insights https://redirect.github.com/nodejs/node/pulse
Sign up for GitHub https://redirect.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://redirect.github.com/login?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
nodejs-github-bothttps://redirect.github.com/nodejs-github-bot
nodejs:mainhttps://redirect.github.com/nodejs/node/tree/main
himself65:himself65/2025/07/22/closehttps://redirect.github.com/himself65/node/tree/himself65/2025/07/22/close
Conversation 17 https://redirect.github.com/nodejs/node/pull/59158
Commits 1 https://redirect.github.com/nodejs/node/pull/59158/commits
Checks 44 https://redirect.github.com/nodejs/node/pull/59158/checks
Files changed https://redirect.github.com/nodejs/node/pull/59158/files
Please reload this pagehttps://redirect.github.com/nodejs/node/pull/59158/files
test: fix flaky test-worker-message-port-transfer-filehandle test https://redirect.github.com/nodejs/node/pull/59158/files#top
Show all changes 1 commit https://redirect.github.com/nodejs/node/pull/59158/files
9b9369c test: fix flaky test-worker-message-port-transfer-filehandle test himself65 Jul 22, 2025 https://redirect.github.com/nodejs/node/pull/59158/commits/9b9369cadca6a1a8e0fd08b63faf7d8c3bca033e
Clear filters https://redirect.github.com/nodejs/node/pull/59158/files
Please reload this pagehttps://redirect.github.com/nodejs/node/pull/59158/files
Please reload this pagehttps://redirect.github.com/nodejs/node/pull/59158/files
test/parallel/test-worker-message-port-transfer-filehandle.jshttps://redirect.github.com/nodejs/node/pull/59158/files#diff-c34e0ff17216641659285fcd530d5cdb4b8f9efa8d0395a6e86460d23a3613de
View file https://redirect.github.com/himself65/node/blob/9b9369cadca6a1a8e0fd08b63faf7d8c3bca033e/test/parallel/test-worker-message-port-transfer-filehandle.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/nodejs/node/pull/59158/{{ revealButtonHref }}
https://redirect.github.com/nodejs/node/pull/59158/files#diff-c34e0ff17216641659285fcd530d5cdb4b8f9efa8d0395a6e86460d23a3613de
https://redirect.github.com/nodejs/node/pull/59158/files#diff-c34e0ff17216641659285fcd530d5cdb4b8f9efa8d0395a6e86460d23a3613de
Please reload this pagehttps://redirect.github.com/nodejs/node/pull/59158/files
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.