Title: Test runner's `--test-rerun-failures` could swallow actual failures on retries · Issue #63424 · nodejs/node · GitHub
Open Graph Title: Test runner's `--test-rerun-failures` could swallow actual failures on retries · Issue #63424 · nodejs/node
X Title: Test runner's `--test-rerun-failures` could swallow actual failures on retries · Issue #63424 · nodejs/node
Description: Version 26.1.0 Platform Darwin ARM64 Subsystem test_runner What steps will reproduce the bug? The following example test file will reproduce the bug: // Demonstrates that `node --test --test-rerun-failures` can mark a failing test as pas...
Open Graph Description: Version 26.1.0 Platform Darwin ARM64 Subsystem test_runner What steps will reproduce the bug? The following example test file will reproduce the bug: // Demonstrates that `node --test --test-rerun-...
X Description: Version 26.1.0 Platform Darwin ARM64 Subsystem test_runner What steps will reproduce the bug? The following example test file will reproduce the bug: // Demonstrates that `node --test --test-rerun-...
Opengraph URL: https://github.com/nodejs/node/issues/63424
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test runner's `--test-rerun-failures` could swallow actual failures on retries","articleBody":"### Version\n\n26.1.0\n\n### Platform\n\n```text\nDarwin ARM64\n```\n\n### Subsystem\n\ntest_runner\n\n### What steps will reproduce the bug?\n\nThe following example test file will reproduce the bug:\n\n```javascript\n// Demonstrates that `node --test --test-rerun-failures` can mark a failing test as passing on retry without executing its body.\n// Root cause: the runtime disambiguator at lib/internal/test_runner/test.js:793-801 keys tests purely by `file:line:column`.\n// A `t.test()` registered inside a factory function gets the same source location regardless of which parent invoked the factory.\n// The disambiguator counter is assigned in execution order across the whole run, so on retry - when the set of running tests changes,\n// the surviving failing test inherits a counter slot that, in attempt 0, belonged to a different (passing) sibling.\n// Node matches by that slot, replaces `this.fn` with a synthetic noop replay, and reports the failure as a pass.\n\nimport { describe, it } from 'node:test';\nimport { strict as assert } from 'node:assert';\n\nfunction makeSuite(shouldPass, label) {\n return async (t) =\u003e {\n await t.test('inner', async () =\u003e {\n if (!shouldPass) assert.fail(`${label} should fail`);\n });\n };\n}\n\ndescribe('parents', { concurrency: false }, () =\u003e {\n it('A passes', makeSuite(true, 'A'));\n it('B fails', makeSuite(false, 'B')); // the only real failure\n it('C passes', makeSuite(true, 'C'));\n});\n```\n\nExecuted with:\n\n```bash\nnode --test --test-rerun-failures=rerun.json repro.mjs # attempt 0\n# B fails as expected; rerun.json now contains A and C plus their\n# inner subtests keyed as \"repro.mjs:13:13\" and \"repro.mjs:13:13:(1)\"\n\nnode --test --test-rerun-failures=rerun.json repro.mjs # retry\n# all 6 tests reported as passing, exit code 0\n# B's assert.fail was never executed\n```\n\n### How often does it reproduce? Is there a required condition?\n\nHappens consistently\n\n### What is the expected behavior? Why is that the expected behavior?\n\nThe test `inner` should not be replaced with a `noop` for `B fails`, allowing it to actually execute\n\n### What do you see instead?\n\nThe `inner` test of `B fails` is skipped completely, due to a erroneous disambiguation\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/atlowChemi","@type":"Person","name":"atlowChemi"},"datePublished":"2026-05-19T09:01:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/63424/node/issues/63424"}
| 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:feaf5cc3-6cdd-54e0-c552-0fdc0a439888 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 93B2:1E311A:14A9FB3:1DEF3D5:6A4CE05B |
| html-safe-nonce | d1c40b78129300c12c0819a8a6f1eda4617dc1a5bb474c2068d01e73d577cc30 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0IyOjFFMzExQToxNEE5RkIzOjFERUYzRDU6NkE0Q0UwNUIiLCJ2aXNpdG9yX2lkIjoiMTIwNDY4NTc3Mzk2MjUyNzYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b727f5a56de3464816739efe541f188803f734271ba2fd748e0c7617d6b1751b |
| hovercard-subject-tag | issue:4475964539 |
| 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/63424/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bc2c3b7a9b81afd3d595800699e70bcdabc277574d27cb0222ff32cbd3248ddb/nodejs/node/issues/63424 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bc2c3b7a9b81afd3d595800699e70bcdabc277574d27cb0222ff32cbd3248ddb/nodejs/node/issues/63424 |
| og:image:alt | Version 26.1.0 Platform Darwin ARM64 Subsystem test_runner What steps will reproduce the bug? The following example test file will reproduce the bug: // Demonstrates that `node --test --test-rerun-... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | atlowChemi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 299b43bca6e02ad35197ffeba30d2466846d5fb02ab96fbced5b5e6cec589fb8 |
| 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 | 3eeb74f55ccd8a31bdaec6839577c592bbf7844c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width