Title: MockTimers does not implement Timeout API correctl · Issue #62815 · nodejs/node · GitHub
Open Graph Title: MockTimers does not implement Timeout API correctl · Issue #62815 · nodejs/node
X Title: MockTimers does not implement Timeout API correctl · Issue #62815 · nodejs/node
Description: Version v24.14.1 v25.8.1 Platform Linux
Open Graph Description: Version v24.14.1 v25.8.1 Platform Linux
X Description: Version v24.14.1 v25.8.1 Platform Linux <hostname> 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC <date> x86_64 GNU/Linux Subsystem No response What steps will reproduce the bu...
Opengraph URL: https://github.com/nodejs/node/issues/62815
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"MockTimers does not implement Timeout API correctl","articleBody":"### Version\n\nv24.14.1\nv25.8.1\n\n### Platform\n\n```text\nLinux \u003chostname\u003e 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC \u003cdate\u003e x86_64 GNU/Linux\n```\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\n```js\nconst test = require(\"node:test\")\ntest.mock.timers.enable()\nlet timeout = setTimeout(() =\u003e {}, 10)\nconst stack = new DisposableStack()\nstack.use(timeout)\n```\n\nHere, `timeout` should be a `Timeout` object, but lacks to `[Symbol.dispose]` property. `stack.use(...)` fails with `TypeError: Symbol(Symbol.dispose) is not a function`.\n\n### How often does it reproduce? Is there a required condition?\n\nTriggers always when: \n\n* MockTimers are enabled,\n* code under test uses `setTimeout` with `using` or other explicit resource management features.\n\n### What is the expected behavior? Why is that the expected behavior?\n\n`Timeout` objects produced by MockTimers should implement the API as documented in Node's documentation, i.e. the objects should have the `[Symbol.dispose]` property, and calling its function should cancel the timeout.\n\nThe `[Symbol.dispose]` property is part of [a stable API](https://nodejs.org/api/timers.html#timeoutsymboldispose).\n\n### What do you see instead?\n\n```js\nconst test = require(\"node:test\")\nlet timeout1 = setTimeout(()=\u003e{})\ntest.mock.timers.enable()\nlet timeout2 = setTimeout(()=\u003e{})\n\nSymbol.dispose in timeout1 //=\u003e true\nSymbol.dispose in timeout2 //=\u003e false\n```\n\n### Additional information\n\nAs an aside, `timeout.close()` is missing as well. While the documentation rightfully labels it as legacy, it is far from deprecated and should be supported by MockTimers.","author":{"url":"https://github.com/Elberet","@type":"Person","name":"Elberet"},"datePublished":"2026-04-19T01:15:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/62815/node/issues/62815"}
| 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:b28593d7-f32c-a4d0-50c0-97659650f41b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CCFE:21F6EA:4CED92:688AC7:6A4C766D |
| html-safe-nonce | 5a963a51cd6950705cc0611b240a689b582d1518f54d346eb40eff1509656dd2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQ0ZFOjIxRjZFQTo0Q0VEOTI6Njg4QUM3OjZBNEM3NjZEIiwidmlzaXRvcl9pZCI6IjE1NDE3MzU5NDQ5ODUyNzgwNjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 296ab702b3702e1faa78120afc2b5c462f4bf41280e53210815972b699d44caa |
| hovercard-subject-tag | issue:4289632719 |
| 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/62815/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fac4640da93ea2e6103c9f35d1b43b93c1da7fa0cc831857a0a1e016044e19c9/nodejs/node/issues/62815 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fac4640da93ea2e6103c9f35d1b43b93c1da7fa0cc831857a0a1e016044e19c9/nodejs/node/issues/62815 |
| og:image:alt | Version v24.14.1 v25.8.1 Platform Linux |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Elberet |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| 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 | 56ac743bebb13694b888673bb7257f4b97a4b7fd |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width