Closed TommyRiquet closed 1 year ago
So what's the issue exactly, --kill-others
or --success
flag?
Your description implies that it's a problem with --kill-others
, but maybe you really meant --success
...?
So what's the issue exactly,
--kill-others
or--success
flag? Your description implies that it's a problem with--kill-others
, but maybe you really meant--success
...?
The --success flag should be triggered whenever the first task exit with a 0 code, here it doesn't.
I also tried removing the --kill-others flag but it didn't change anything
--success
doesn't trigger anything, it defines which process guides the exit code of concurrently.
Also note that the --help
says that
-s, --success Which command(s) must exit with code 0 in order
for concurrently exit with code 0 too. Options
are:
- "first" for the first command to exit;
- "last" for the last command to exit;
- "all" for all commands;
- "command-{name}"/"command-{index}" for the
commands with that name or index;
- "!command-{name}"/"!command-{index}" for all
commands but the ones with that name or index.
[default: "all"]
Nevermind, let me rephrase my statement. Please excuse my poor choice of words, as English is not my native language.
The command mentioned earlier that when the first process exits with a code of 0, the concurrently process should also exit with code 0.
However, this was not the case in this instance.
Although the process did exit with code 0, the workflow continued until I manually cancelled it.
If you would like to review it yourself, here is the GitHub action in question. https://github.com/TommyRiquet/PVonWeb/actions/runs/5234324290/jobs/9450387941
Nevermind, let me rephrase my statement. Please excuse my poor choice of words, as English is not my native language.
The command mentioned earlier that when the first process exits with a code of 0, the concurrently process should also exit with code 0.
However, this was not the case in this instance.
Although the process did exit with code 0, the workflow continued until I manually cancelled it.
If you would like to review it yourself, here is the GitHub action in question. https://github.com/TommyRiquet/PVonWeb/actions/runs/5234324290/jobs/9450387941
That's because you were using the --kill-others-on-fail
flag in the linked workflow. With this flag it will kill other processes only if one command exits with non zero status code.
Okay, I apologize for any confusion . I misunderstood the flag. I switched to the "--kill-others" flag and everything worked perfectly fine. I'm sorry for any inconvenience caused by the time lost.
Description: I'm using concurrently in an npm script to start my backend application and my tests. When the tests finish, it correctly returns a code 0 but concurrently ignores it and I have to cancel the workflow manually. Exemple:
"test-ci": "concurrently --kill-others -s first \"wait-on http://localhost:3001 && npm run test\" \"npm run testStart\""
Expected Behavior: concurrently should return 0
Environment: OS : Windows 10 Concurrently Version : ^8.2.0
Reproduction: Try to run an npm script in a github runner with the following command
concurrently --kill-others -s first \"wait-on http://localhost:3001 && npm run test\" \"npm run testStart\"
Solution : I tried to downgrade the concurrently version to 8.0.0 and it fixed the workflow so I guess it has to do something with the newer version.