Replies: 1 comment
|
The current portable shell treats & as asynchronous for status purposes: it waits for background jobs before resolving, but a background job's non-zero exit is reported and the overall shell result remains 0. Yarn's current shell tests codify that behavior, and there is no wait/status-aggregation hook exposed by the portable shell. For CI, either chain the checks (yarn lint:a && yarn lint:b) or use a runner/script that owns the child processes and exits non-zero if any failed. & alone cannot make yarn run propagate those failures. Refs: current background-job tests and portable-shell implementation. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Yarn's portable shell supports running tasks in parallel with the
task &syntax. This works great when tasks succeed:However, when the background jobs fail, the failures are ignored and yarn run succeeds anyway:
Notice how
yarn run thing-serialcorrectly propagatesexit 1fromthing:1. However,yarn run thing-parallelignores both non-zero exit codes and succeeds.Is there a way to propagate failures from background jobs in yarn? If not, what are the intended use-cases for this feature? The fact that they always succeed disqualifies them from many scenarios IMO (for example running multiple linters in parallel).
All reactions