concurrently: How to ignore exit code 1 when a process is killed ?
In package.json I’ve the following line with the purpose to:
- start testrpc-sc
- run coverage
- when coverage is done -> kill the testrpc-sc process
"coverage": "concurrently -k \"node_modules\\.bin\\testrpc-sc --port 8555\" \"node_modules\\.bin\\solidity-coverage\"",
However my npm command fails because testrpc-sc is killed and returns a exit 1.
See logging:
[1] Istanbul coverage reports generated [1] Cleaning up… [1] node_modules.bin\solidity-coverage exited with code 0 –> Sending SIGTERM to other processes… [0] node_modules.bin\testrpc-sc --port 8555 exited with code 1 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! supplychainlog@1.0.0 coverage:
concurrently --kill-others "node_modules\.bin\testrpc-sc --port 8555" "node_modules\.bin\solidity-coverage"npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the supplychainlog@1.0.0 coverage script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
How to let npm know that a Exit status 1 is ok ?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 17 (4 by maintainers)
Commits related to this issue
- Make success condition use exiting order, as per docs ...instead of command spec order. Relates to #127 — committed to open-cli-tools/concurrently by gustavohenke 6 years ago
Use
concurrently --success first, this will make only the exit status of coverage (first child that exited) matter. I’m am running e2e tests,|| truesolution does not work because it hides all errors.I can also confirm that using
--success lastdidn’t work for me but switching the order and using--success firstdid.This is the command that wasn’t working (always non-zero exit despite using
--success last, I speculate the exit code is from--kill-otherskilling the first command):This one works and gives me the exit code from
npm run cypress:cl:Strangely
--success firstworks while--success lastdoes not.I still see same issue
I am trying to run two scripts at once with
concurrently. The basic command looks something like this:Which in turn calls (local):
Or on remote (teamcity host):
The tests run just fine (local & remote). However, I keep getting exit code 1. Even if I use
concurrently -k --success firstI still get acode 1even with--success first.I tried various ways for
json-serverto gracefully receive this signal. Nothing seems to work.mock-webapi.js
I found a workable solution here: https://stackoverflow.com/questions/26814034/silencing-errors-on-failures-for-npm-run-script
My solution is:
And full command is now: