Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--restart-tries interaction with --kill-others #179

Open
mawhidby opened this issue Dec 14, 2018 · 3 comments
Open

--restart-tries interaction with --kill-others #179

mawhidby opened this issue Dec 14, 2018 · 3 comments

Comments

@mawhidby
Copy link

mawhidby commented Dec 14, 2018

Hey there!

I'm trying to use concurrently on our CI server to run our integration tests. I'm running into a similar issue as that documented in #177, the difference being I'm also using restartTries to help ensure the server is up before the integration tests run. With this setup, the tests pass, successfully killing the server process, but it restarts the server because of restartTries.

concurrently --kill-others --success first --restart-tries 2 --restart-after 5000 "npm start" "npm test"

...

[1] npm test exited with code 0
--> Sending SIGTERM to other processes..
[0] 2018-12-14T03:31:02.097Z - warn:    Caught SIGTERM, exiting
[0] npm start exited with code SIGTERM
[0] npm start restarted

Any suggestions around this? I'm not sure if this is a supported use case, otherwise it seems like I'll need to modify our tests themselves to ensure the server is up and running

@mawhidby
Copy link
Author

I guess one way around this would be to have restart-process.js explicitly check for the SIGTERM, but I'm not sure about the side-effects this may cause

handle(commands) {
        if (this.tries === 0) {
            return commands;
        }

        commands.map(command => command.close.pipe(
            take(this.tries),
            takeWhile(code => code !== 0 && code !== 'SIGTERM')
...

@runloop
Copy link

runloop commented Jun 2, 2020

I ran into this exact issue. My solution was to write a script that delays the start of my other process long enough to ensure the server is up and running before it's executed.

@marklagendijk
Copy link

For starting a server and then running tests you can use start-server-and-test. If you need to run multiple servers you can use concurrently to start all of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants