jest icon indicating copy to clipboard operation
jest copied to clipboard

chore: add worker build on CI

Open SimenB opened this issue 6 years ago • 15 comments

Summary

From #7610. @rickhanlonii could you take a look? 🙂

Test plan

Will fail (for now)

SimenB avatar Jan 16 '19 07:01 SimenB

worker_threads is unflagged in node 11.7.0, so the extra job isn't necessary. When (if) we land #7681 I'll update this PR to remove all the disableWorkerThreads: true and see where we're at

SimenB avatar Jan 22 '19 23:01 SimenB

Circle has node 11.8 now, which has the umask fix. Rebased, hopefully a better result this time 🙂

SimenB avatar Jan 29 '19 18:01 SimenB

We test threads but we're actually running our test suite serially. Maybe it's worth to run tests by default on 2 or 4 workers and run in band e.g. on travis or somewhere?

thymikee avatar Jan 29 '19 18:01 thymikee

I wanna see that tests pass without being stupidly slow first. If they do, then we can test by actually spinning up workers 🙂

These have to be fixed first: image

SimenB avatar Jan 29 '19 18:01 SimenB

haha, it just died 😛 But looking at, and fixing, multiProjectRunner might be what we're missing. If anybody wants to pick it up

SimenB avatar Jan 29 '19 18:01 SimenB

Test failures on node 12, that's odd...

SimenB avatar Aug 22 '19 09:08 SimenB

whatever that old issue was, it seems to have been fixed 👍

image

Will need to look into why coverage fails, but this is super promising

SimenB avatar Nov 10 '19 08:11 SimenB

Very interesting - tests fail on circus, but passes on GH Actions. The failing test on CI passes on my local machine. Very odd...

SimenB avatar Apr 27 '20 20:04 SimenB

for those that want to test this, check this patch-package https://gist.github.com/sibelius/c6ef3f0890814dd4163a9ada0cd739f1

sibelius avatar Jun 08 '20 17:06 sibelius

@sibelius very interested in hearing numbers if you play with - does it impact memory/cpu usage?

SimenB avatar Jun 08 '20 18:06 SimenB

I've tried to use worker_threads because child process was failing for us, here is the issue https://github.com/facebook/jest/issues/10144

When using worker_threads we got some

CircleCI received exit code 137 

137 means Out of Memory.

So worker threads is kind of worse than child process right now for us

mongodb-memory-server was causing OOM for us because it was spinning 1 mongod per test file, we fixed this here https://github.com/shelfio/jest-mongodb/pull/209

but worker_threads still leaking on CircleCI

but it does not leak when running local, --logHeapUsage show always less than 300mb, so not sure if leakage is because of node 12.18.0 or because of docker or circleci specific

sibelius avatar Jun 08 '20 18:06 sibelius

we fixed most issues of our tests

and now worker_threads is working fine for us (node 12.18.0)

we didn't notice any improvement in cpu time or memory usage

sibelius avatar Jun 09 '20 20:06 sibelius

https://www.npmjs.com/package/piscina just leaving this here as something to maybe explore in the future, who knows, maybe it's faster than jest-workers worker threads farm impl

jeysal avatar Jun 14 '20 18:06 jeysal

what is missing here?

sibelius avatar Oct 01 '24 10:10 sibelius

how can I enable worker threads on jest config ?

sibelius avatar Oct 01 '24 10:10 sibelius

Closing due to inactivity.

cpojer avatar Jul 06 '25 06:07 cpojer

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

github-actions[bot] avatar Aug 06 '25 00:08 github-actions[bot]