-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
Add hasRef to worker_threads.Worker #42091
Copy link
Copy link
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.workerIssues and PRs related to Worker support.Issues and PRs related to Worker support.
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.workerIssues and PRs related to Worker support.Issues and PRs related to Worker support.
Type
Fields
Give feedbackNo fields configured for issues without a type.
What is the problem this feature will solve?
Jest has a
--detect-open-handlesflag which attempts to figure out (usingasync_hooks) what resources (timer/server etc.) are preventing a test run/node from exiting. To avoid false positives we perform filtering before presenting the list to the user. One of those things is to check if aTimerhas beenunrefedor not, viaTimer.hasRef.However,
Workers have nohasRef, even though they have the{un}refpair, so Jest will currently print false positives forWorkers that have hadunrefcalled.What is the feature you are proposing to solve the problem?
Add
Worker.hasRefsimilar to theTimerAPI.What alternatives have you considered?
No response