Title: node:test run() w/ isolation=none waits for beforeExit · Issue #57234 · nodejs/node · GitHub
Open Graph Title: node:test run() w/ isolation=none waits for beforeExit · Issue #57234 · nodejs/node
X Title: node:test run() w/ isolation=none waits for beforeExit · Issue #57234 · nodejs/node
Description: Version 23.4 Platform Linux minitower 6.12.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 10 Jan 2025 00:39:41 +0000 x86_64 GNU/Linux Subsystem node:test What steps will reproduce the bug? const {run} = require('node:test'); const t0 = Date.now()...
Open Graph Description: Version 23.4 Platform Linux minitower 6.12.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 10 Jan 2025 00:39:41 +0000 x86_64 GNU/Linux Subsystem node:test What steps will reproduce the bug? const {run} = req...
X Description: Version 23.4 Platform Linux minitower 6.12.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 10 Jan 2025 00:39:41 +0000 x86_64 GNU/Linux Subsystem node:test What steps will reproduce the bug? const {run} = req...
Opengraph URL: https://github.com/nodejs/node/issues/57234
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"node:test run() w/ isolation=none waits for beforeExit","articleBody":"### Version\n\n23.4\n\n### Platform\n\n```text\nLinux minitower 6.12.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 10 Jan 2025 00:39:41 +0000 x86_64 GNU/Linux\n```\n\n### Subsystem\n\nnode:test\n\n### What steps will reproduce the bug?\n\n```javascript\nconst {run} = require('node:test');\n\nconst t0 = Date.now()\nconst s = run({\n isolation: 'none',\n files: [__dirname + '/code.test.js'],\n // timeout: 2000, // no effect\n // forceExit: true, // no effect\n});\n[ 'close', 'error', 'data', 'end', 'finish' ].forEach(e => {\n s.on(e, x => console.log(Date.now() - t0, e, x?.type))\n});\n\nsetTimeout(() => {console.log('************* t=3000')}, 3000)\n/*\n5 data test:enqueue\n5 data test:dequeue\n5 data test:enqueue\n6 data test:complete\n6 data test:start\n6 data test:pass\n6 data test:dequeue\n6 data test:complete\n6 data test:start\n6 data test:fail\n************* t=3000\n3006 data test:plan\n3006 data test:diagnostic\n3006 data test:diagnostic\n3006 data test:diagnostic\n3006 data test:diagnostic\n3006 data test:diagnostic\n3006 data test:diagnostic\n3006 data test:diagnostic\n3006 data test:diagnostic\n3006 data test:summary\n3007 end undefined\n3007 close undefined\n*/\n\n```\n\nAnd if we were to emit a \"beforeExit\" event:\n\n```javascript\nsetTimeout(() => {\n console.log('************* beforeExit')\n process.emit('beforeExit')\n}, 1500)\n\n/*\n4 data test:enqueue\n5 data test:dequeue\n5 data test:enqueue\n6 data test:complete\n6 data test:start\n6 data test:pass\n6 data test:dequeue\n6 data test:complete\n6 data test:start\n6 data test:fail\n************* beforeExit\n1504 data test:plan\n1504 data test:diagnostic\n1504 data test:diagnostic\n1504 data test:diagnostic\n1504 data test:diagnostic\n1504 data test:diagnostic\n1504 data test:diagnostic\n1504 data test:diagnostic\n1504 data test:diagnostic\n1504 data test:summary\n1504 end undefined\n1505 close undefined\n************* t=3000\n*/\n```\n\n### How often does it reproduce? Is there a required condition?\n\n100% reproduceable.\n\n### What is the expected behavior? Why is that the expected behavior?\n\ntest runner should end after all planned tests are complete.\n\nOR\n\nit should allow me to explicitly declare my test plan so it knows after the Nth test that no more tests are gonig to be enqueued.\n\n### What do you see instead?\n\ntest runner waits for the \"beforeExit\" event before it terminates.\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/aecepoglu","@type":"Person","name":"aecepoglu"},"datePublished":"2025-02-28T10:07:35Z","url":"https://github.com/nodejs/node/issues/57234"}
| react-profiling | 0 |
| react-import-map | react,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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:884639c5-7e67-7a4c-27f9-3079a638b62f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B584:301095:7413B9:9D8A2C:6AED2BB8 |
| html-safe-nonce | 2ef8ac16199c69fd309c3125f30dc32d6109881d8890123d656898fc177abb15 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTg0OjMwMTA5NTo3NDEzQjk6OUQ4QTJDOjZBRUQyQkI4IiwidmlzaXRvcl9pZCI6IjkyMDkyNzQ4MDkyMjY5NjM4OTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fea709c4ac0017432afa05f4bf17ad8bba850f8e178e3db75ac12b778b4b1c8f |
| hovercard-subject-tag | issue:2886738663 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/57234/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1058f47cb6433b67c431afaaf9ed2090c237f57f4deb3e9bc55eda4dc9a38ffd/nodejs/node/issues/57234 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1058f47cb6433b67c431afaaf9ed2090c237f57f4deb3e9bc55eda4dc9a38ffd/nodejs/node/issues/57234 |
| og:image:alt | Version 23.4 Platform Linux minitower 6.12.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 10 Jan 2025 00:39:41 +0000 x86_64 GNU/Linux Subsystem node:test What steps will reproduce the bug? const {run} = req... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aecepoglu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 98b41fa4b5635ceb45a4c54320fced73817ff290 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width