Title: Test runner file exits with code 1 when awaiting tests + filtering · Issue #64203 · nodejs/node · GitHub
Open Graph Title: Test runner file exits with code 1 when awaiting tests + filtering · Issue #64203 · nodejs/node
X Title: Test runner file exits with code 1 when awaiting tests + filtering · Issue #64203 · nodejs/node
Description: Version v26.3.0 Platform Microsoft Windows NT 10.0.26200.0 x64 also reproduces under WSL: Linux dell-xps-3 6.18.33.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 18 21:54:43 UTC 2026 x86_64 GNU/Linux Subsystem node:test What st...
Open Graph Description: Version v26.3.0 Platform Microsoft Windows NT 10.0.26200.0 x64 also reproduces under WSL: Linux dell-xps-3 6.18.33.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 18 21:54:43 UTC 2026 x86_...
X Description: Version v26.3.0 Platform Microsoft Windows NT 10.0.26200.0 x64 also reproduces under WSL: Linux dell-xps-3 6.18.33.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 18 21:54:43 UTC 2026 x86_...
Opengraph URL: https://github.com/nodejs/node/issues/64203
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test runner file exits with code 1 when awaiting tests + filtering","articleBody":"### Version\n\nv26.3.0\n\n### Platform\n\n```text\nMicrosoft Windows NT 10.0.26200.0 x64\n```\n\nalso reproduces under WSL:\n\n```\nLinux dell-xps-3 6.18.33.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 18 21:54:43 UTC 2026 x86_64 GNU/Linux\n```\n\n### Subsystem\n\nnode:test\n\n### What steps will reproduce the bug?\n\nWeird one to minify, here's what I got it down to:\n\n```js\nimport test from \"node:test\";\n\nawait test.suite(\"Suite A\", async (t) => {\n});\n\nawait test.suite(\"Suite B\", async (t) => {\n await test(\"Test 1\", async () => {\n });\n await test(\"Test 2\", async () => {\n });\n});\n\nawait test.suite(\"Suite C\", async () => {\n await test(\"Test 3\", async () => {\n });\n});\n```\n\nThen `node --test --test-name-pattern=C test.js` (or any other pattern than `B`) gives the following error output:\n\n```\n▶ Suite C\n ✔ Test 3 (0.8439ms)\n✔ Suite C (1.0333ms)\n✖ test.js (54.3035ms)\nℹ tests 2\nℹ suites 1\nℹ pass 1\nℹ fail 1\nℹ cancelled 0\nℹ skipped 0\nℹ todo 0\nℹ duration_ms 59.748\n```\n\nAlso reproduces using `.only` rather than `--test-name-pattern`\n\nWithout `--test` it produces the following output, with an exit code of 1 - note the change to `cancelled`!:\n\n```\n▶ Suite C\n ✔ Test 3 (0.175ms)\n✔ Suite C (1.024ms)\nℹ tests 2\nℹ suites 1\nℹ pass 1\nℹ fail 0\nℹ cancelled 1\nℹ skipped 0\nℹ todo 0\nℹ duration_ms 6.6097\n```\n\n`--trace-exit` does not list anything additional.\nLogging `exitCode` in `process.on(\"exit\")` is `1`.\n\nUsing `--test-reporter=tap` only lists expected `ok` tests without `--test`, with it it also lists:\n\n```\n# Subtest: test.js\nnot ok 1 - test.js\n ---\n duration_ms: 59.742\n type: 'test'\n location: 'D:\\\\scratch\\\\node-test-repro\\\\test.js:1:1'\n failureType: 'testCodeFailure'\n exitCode: 1\n signal: ~\n error: 'test failed'\n code: 'ERR_TEST_FAILURE'\n ...\n1..2\n```\n\nas expected.\n\nRemoving any of the awaits, from either suites or tests seems to resolve the issue.\n\n### How often does it reproduce? Is there a required condition?\n\nSeemingly reliably, though given it seems to be a timing related issue I can't promise that...\n\n### What is the expected behavior? Why is that the expected behavior?\n\nIt's quite possible there is some legitimate usage error here, but it should at least report what it is clearly, and certainly not only in such specific conditions!\n\nThe reason I'm using awaits in the tests in the suites is due to the editor / linter getting fussy about unawaited promises due to the types. This is a generally very handy check, so I'm loath to ignore it...\n\n### What do you see instead?\n\n(provided above)\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/simonbuchan","@type":"Person","name":"simonbuchan"},"datePublished":"2026-06-30T00:03:09Z","url":"https://github.com/nodejs/node/issues/64203"}
| 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:df3c5702-11a8-9c27-abeb-e77699ac874f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E47A:F5278:8E971D:BCCFB6:6AED2ABB |
| html-safe-nonce | 4ff9de3ad93301738939d9eee0c4c83acb6aecf4106b249f17947cc7c6fa78f3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDdBOkY1Mjc4OjhFOTcxRDpCQ0NGQjY6NkFFRDJBQkIiLCJ2aXNpdG9yX2lkIjoiMTcyNTIxMTc5MzkyMDE3NDc3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 26a605eeb7056956cb532af72397c121ca8b6512ce3bed45fe6552c7ab9c0684 |
| hovercard-subject-tag | issue:4772498198 |
| 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/64203/issue_layout |
| twitter:image | https://opengraph.githubassets.com/27adc86008d77f599f42e60a0a117372bb14f76c42b81aa6db584cf0e6c8dc1f/nodejs/node/issues/64203 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/27adc86008d77f599f42e60a0a117372bb14f76c42b81aa6db584cf0e6c8dc1f/nodejs/node/issues/64203 |
| og:image:alt | Version v26.3.0 Platform Microsoft Windows NT 10.0.26200.0 x64 also reproduces under WSL: Linux dell-xps-3 6.18.33.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 18 21:54:43 UTC 2026 x86_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | simonbuchan |
| 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