Skip to content

tmp installs process listeners multiple times #129

@silkentrance

Description

@silkentrance

Operating System

  • all OS

NodeJS Version

  • all versions

Tmp Version

all versions

Expected Behavior

tmp must not try to install process exit and uncaughtException listeners multiple times.

Experienced Behavior

tmp installs listeners multiple times, causing a warning "possible event listener/memory leak".
This occurs when other projects use facebook/jest which removes and thus reloads existing modules during each test run. And it might also occur when using node's vm (sandboxed modules) API.

Rationale

Personally, I believe that facebook/jest is doing it wrong, but for the time being we should provide a work around for that problem.

As for node's sandbox VM module, we need to have additional tests that make sure that in such a scenario the listeners will not be added multiple times. Implementing such a test case properly will
require preventing tmp to install its listeners safely. Since this cannot be done, we will simply make sure that in a multiple sandbox environment the aforementioned warning will not be triggered.

In addition, we should notify the owners of dependent other projects of the update.
And, by analyzing the package dependencies of https://github.com/chrisprice/react-app-webdriver, the most prominent would be

  • makeerror
  • selenium-webdriver

See Also

#125

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions