mysticatea / npm-run-all

A CLI tool to run multiple npm-scripts in parallel or sequential.
MIT License
5.72k stars 240 forks source link

--race appears to be non-functional #237

Open slavistan opened 2 years ago

slavistan commented 2 years ago

I'm running into trouble using run-p -r .... Using this package.json, executing npm x run-p -r sleep2 sleep4 (on a nix host) should start two sleepers which should both terminate after two seconds. The expected output is wakey wakey* as the 4-second sleeper should be terminated right after the first one finishes.

{
 ...
  "scripts": {
    "sleep2": "sleep 2 && echo wakey wakey",
    "sleep4": "sleep 4 && echo rise and shine"
  },
 ...
}

However, I have to wait the full 4 seconds for the run-p command to terminate and rise and shine is printed as well. According to my understanding of what run-p -r is supposed to do this is unexpected. Kindly correct me if I'm wrong.

This may be related to #139, although sleep certainly is not misbehaving :)

webartoli commented 7 months ago

Same issue here:

I'm trying to setup storybook tests that requires a live webserver during the test process.

{
  // ...
  "scripts": {
    "test:sb": "run-p --race --print-label test:sb:*",
    "test:sb:server": "http-server storybook-static --port 6006 --silent",
    "test:sb:runner": "wait-on -t 1m tcp:6006 && test-storybook --junit"
    // ...
  }
}

On windows client running npm run test:sb works as expected. On ci runner (gitlab-ci, docker agent, node:lts-slim) running the same command the server keep alive.

webartoli commented 6 months ago

Solved installing package procps. I have figured out that on *nix package an additional package procps is required and can be installed with:

# debian/ubuntu based distro
$ [sudo] apt install -y procps

# alpine based distro
$ apk add -y procps