Repository navigation
Add hasRef to worker_threads.Worker #42091
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.workerIssues and PRs related to the worker_threads module and Worker API.Issues and PRs related to the worker_threads module and Worker API.
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Feb 23, 2022 What about other APIs that have an
unreffunction? ChildProcess, FSWatcher, etc.I haven't gotten a bug report in Jest about them, so I have no opinion 😀
On a more serious note, I think it makes sense for
ref,unrefandhasRefto always exist together.- addedworkerIssues and PRs related to the worker_threads module and Worker API.Issues and PRs related to the worker_threads module and Worker API.
on Feb 23, 2022 @SimenB would you be interested in contributing a PR? I am happy to guide you, the code is in
io.jsandworker.jsmostly :)Io.js, that's a blast from the past! Happy to contribute it if it'll get accepted 🙂
Reacted by Benjamin GruenbaumSent a PR for this: #42756
Reacted by Simen Bekkhus15 remaining items
- added a commit that references this issue
on Apr 28, 2022 - added a commit that references this issue
on May 2, 2022 - added a commit that references this issue
on May 2, 2022 @RaisinTen can confirm the jest detection works correctly on 18.1.0, thank you!
Reacted by Darshan Sen- added 2 commits that reference this issue
on May 31, 2022 - added a commit that references this issue
on Jun 27, 2022 - added 2 commits that reference this issue
on Jul 12, 2022 - added 2 commits that reference this issue
on Jul 31, 2022 - added 2 commits that reference this issue
on Oct 10, 2022
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.workerIssues and PRs related to the worker_threads module and Worker API.Issues and PRs related to the worker_threads module and Worker API.
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