-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Run in worker threads #1428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Would solve #1332. |
FYI on Jest using workers and also spread work based on the previous test duration: |
@sindresorhus has funded $60.00 to this issue. See it on IssueHunt |
Issue hunt link is auth-walled :/ Any way to see it without associating it with my account? |
Edited the OP to mention https://nodejs.org/api/worker_threads.html. |
@issuehuntfest has funded $200.00 to this issue. See it on IssueHunt |
@futpib has funded $100.00 to this issue.
|
We should only support worker threads and Node.js 12.16 or higher. I think it could even be the default on supported platforms. Despite the "pool" concepts discussed here, you'll have a better chance of getting this shipped by modifying |
what about using jest-worker for this? |
I have worked on this issue, and I should have something ready to review by next week. I have not used a pooled approach, to keep things more similar to the current strategy. |
@dnlup if you submit your PR on IssueHunt (I'm not entirely sure how) there's 270 USD waiting for you 😉 |
😄 I did submit it, maybe I have to submit it again? |
@novemberborn has rewarded $270.00 to @dnlup. See it on IssueHunt
|
Incredible work here, thank you @dnlup. I can't tell who, but Can we please not get in the habit of doing that? I didn't write all that just for it to be strike-through'd, and it's quite annoying to have someone else manhandle my text. Just a sidenote. |
I can't tell from the edit history either, very strange. I've removed them. |
thank you @Qix- |
See #1428 (comment)
Right now it appears the process is forked for each test and then the test is ran. This is unideal for a vast amount of reasons.
Upon discussion with Sindre, it was decided that we should explore moving into a pooled approach (where instances of the following classes shared a common interface and abstracted away the strategy for executing individual tests):
SingleProcessTestPool
would run all tests in the main process without forkingForkTestPool
would fork the processN
times (whereN
is the number of processors) and distribute tests out between them as they become idleIn the future, this could be expanded to a
WorkerTestPool
to implement support for workers.This would give us the ability to decide upon the execution strategy based on a number of factors:
<N
tests, useSingleProcessTestPool
; otherwise, useForkTestPool
--no-fork
or equivalent flag is provided, forceSingleProcessTestPool
--inspect
or--inspect-brk
is specified, forceSingleProcessTestPool
(ref Debugging with the Node.js debugger #1108)I'm not entirely sure how much work this would require, but consider this issue a 'jumping off' point for discussion.
EDIT: This might be of interest as well: https://nodejs.org/api/worker_threads.html
IssueHunt Summary
Backers (Total: $300.00)
Submitted pull Requests
Tips
The text was updated successfully, but these errors were encountered: