question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

write EPIPE when using ChildProcessWorker.js

See original GitHub issue

🐛 Bug Report

events.js:292
 
      throw er; // Unhandled 'error' event
 
      ^
 

 
Error: write EPIPE
 
    at ChildProcess.target._send (internal/child_process.js:806:20)
 
    at ChildProcess.target.send (internal/child_process.js:677:19)
 
    at ChildProcessWorker.send (/home/circleci/app/node_modules/jest-worker/build/workers/ChildProcessWorker.js:291:17)
 
    at WorkerPool.send (/home/circleci/app/node_modules/jest-worker/build/WorkerPool.js:32:34)
 
    at Farm._process (/home/circleci/app/node_modules/jest-worker/build/Farm.js:129:10)
 
    at Farm._enqueue (/home/circleci/app/node_modules/jest-worker/build/Farm.js:152:10)
 
    at Farm._push (/home/circleci/app/node_modules/jest-worker/build/Farm.js:159:12)
 
    at /home/circleci/app/node_modules/jest-worker/build/Farm.js:90:14
 
    at new Promise (<anonymous>)
 
    at Farm.doWork (/home/circleci/app/node_modules/jest-worker/build/Farm.js:56:12)
 
Emitted 'error' event on ChildProcess instance at:
 
    at internal/child_process.js:810:39
 
    at processTicksAndRejections (internal/process/task_queues.js:79:11) {
 
  errno: 'EPIPE',
 
  code: 'EPIPE',
 
  syscall: 'write'
 
}
 
error Command failed with exit code 1.
 

We run our tests in CircleCI using maxWorker=4

For some tests ChildProcessWorker.send fails and break all the tests execution

To Reproduce

Try to run many tests at the same time

Expected behavior

It should not break

Link to repl or repo (highly encouraged)

our internal repo is similar to this one https://github.com/entria/entria-fullstack/tree/master/packages/server We use a mongodb memory server to run tests.

envinfo

System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
  Binaries:
    Node: 12.18.0 - ~/.nvm/versions/node/v12.18.0/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v12.18.0/bin/npm
  npmPackages:
    jest: 26.0.1 => 26.0.1 

it can be related to https://github.com/facebook/jest/issues/8507 not sure if this is node version specific

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
sibeliuscommented, Oct 2, 2020

this happens when your tests have memory leak

3reactions
alexyacommented, Feb 22, 2021

I met a similar issue like this when I ran jest --coverage

Updated: I have 64G memory, even if there is some memory leak, it should not crash the Jest itself. And it is very hard for us to “find” the location where memory leaks when our project is very big. It will be much helpful if the Jest could help us to wrap the issue, ignore the crash case or mark the case with failure, and run the left.

os: win10 LTSC 2019 (updated to latest) node: 10.19.0 jest: 26.0.1 ( and tried 25.5.4) yarn: 1.22.4

Test Suites: 1 skipped, 165 passed, 165 of 476 total
Tests:       67 skipped, 3372 passed, 3439 total
Snapshots:   31 passed, 31 total
Time:        223sevents.js:174
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at ChildProcess.target._send (internal/child_process.js:762:20)
    at ChildProcess.target.send (internal/child_process.js:634:19)
    at ChildProcessWorker.send (C:\src\web-2nd\node_modules\jest-worker\build\workers\ChildProcessWorker.js:291:17)
    at WorkerPool.send (C:\src\web-2nd\node_modules\jest-worker\build\WorkerPool.js:32:34)
    at Farm._process (C:\src\web-2nd\node_modules\jest-worker\build\Farm.js:129:10)
    at Farm._enqueue (C:\src\web-2nd\node_modules\jest-worker\build\Farm.js:152:10)
    at Farm._push (C:\src\web-2nd\node_modules\jest-worker\build\Farm.js:159:12)
    at Promise (C:\src\web-2nd\node_modules\jest-worker\build\Farm.js:90:14)
    at new Promise (<anonymous>)
    at Farm.doWork (C:\src\web-2nd\node_modules\jest-worker\build\Farm.js:56:12)
Emitted 'error' event at:
    at process.nextTick (internal/child_process.js:766:39)
    at process._tickCallback (internal/process/next_tick.js:61:11)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Read more comments on GitHub >

github_iconTop Results From Across the Web

events.js:288 Error: write EPIPE when executing tests with Jest
It turns out that by changing some libraries in package.json the error dissapears: Before (KO): "babel-jest": "^24.9.0", "jest": "^26.0.1",.
Read more >
80% of the time build fails with Error: write EPIPE error
Hi, I keep getting this error when using v4.0.0: Module build failed: Error: write EPIPE at _errnoException (util.js:1031:13) at WriteWrap.
Read more >
[GitHub] [apisix-dashboard] wannianma opened a new issue ...
Describe the bug Build v2.4, get Some js build error, ... Unhandled 'error' event ^ Error: write EPIPE at ChildProcess.target.
Read more >
Error: write EPIPE - ERPNext Forum
I get this when bench build or bench build --app frappe . Doesn't happen with other app. Building frappe assets... events.js:174 throw er;...
Read more >
Error: write EPIPE - Google Groups
We are getting EPIPE errors. ... at errnoException (net.js:770:11)", " at Object. ... EPIPE means you're writing to a pipe or socket when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found