How do I get my webserver to restart without exiting Cypress

22 Views Asked by At

I have a wrangler webserver which runs a couple of ports (e.g. 3100-3102). I have a Cypress integration test server wrapped in a Node script (for parallelisation in an azure pipeline).

The wrangler webserver is prone to the legendary and ongoing Network connection lost. issue. This delays the integration tests and my devs have to manually restart them. I'd like to automate that process.

  • Detecting the failure was easy enough when I wrapped it in a node script and checked for that error.
  • spawned.kill() results in the ports still being in use.
  • Running lsof -t -i tcp:3101-3102 | xargs kill freed up the ports but then the Cypress server shut down in response. I do not want Cypress to shut down.
  • I'm happy to SIGSTOP the Cypress process and SIGCONT when the webserver restarts so that it can run all the integration tests with minimum delay.

How can I restart my webserver without Cypress shutting down?

0

There are 0 best solutions below