Skip to content

Memory leaks due to setTimeout/setImmediate/setInterval spies #2771

@johnp

Description

@johnp

Please avoid duplicates

Reproducible test case

https://runkit.com/johnp-gh/nock-nock-2771

Nock Version

14.0.0-beta.9

Node Version

22.6.0

TypeScript Version

No response

What happened?

The Nock internal setTimeout/setInterval/setImmediate spies leak memory, as shown in the reproducer and seen in webdriverio/webdriverio#13219 (comment). I don't think that Nock really intends to hold on to already finished, or cleared, timers.

This same issue has previously already reported here, but those tickets were later closed:

Would you be interested in contributing a fix?

  • yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions