Ava: Run in worker threads

Created on 29 Jun 2017  路  10Comments  路  Source: avajs/ava


Issuehunt badges

See https://github.com/avajs/ava/issues/1428#issuecomment-633456574


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 forking - `ForkTestPool` would fork the process `N` times (where `N` is the number of processors) and distribute tests out between them as they become idle In the future, this could be expanded to a `WorkerTestPool` to implement support for [workers](/nodejs/worker). This would give us the ability to decide upon the execution strategy based on a number of factors: - For `

EDIT: This might be of interest as well: https://nodejs.org/api/worker_threads.html




IssueHunt Summary

Backers (Total: $300.00)

- #2011 Migrate forking to a pooled worker design #1428

Become a backer now!

Or submit a pull request to get the deposits!

Tips

IssueHunt has been backed by the following sponsors. Become a sponsor


Funded on Issuehunt enhancement help wanted priority scheduling

Most helpful comment

@issuehuntfest has funded $200.00 to this issue. See it on IssueHunt

All 10 comments

  • SingleProcessTestPool would run all tests in the main process without forking

Would solve #1332.

FYI on Jest using workers and also spread work based on the previous test duration:
http://facebook.github.io/jest/blog/2016/03/11/javascript-unit-testing-performance.html

@unional Yes, that's a good way to handle it, and with the design @Qix- is describing, it shouldn't be too hard to do.

@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?

@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 lib/fork.js.

what about using jest-worker for this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

avaly picture avaly  路  4Comments

carpasse picture carpasse  路  3Comments

sindresorhus picture sindresorhus  路  4Comments

ehmicky picture ehmicky  路  4Comments

leegee picture leegee  路  4Comments