pento / testpress

Tool for helping you get a WordPress Core test environment up and running.
GNU General Public License v2.0
68 stars 2 forks source link

Ensure the Docker containers are shutdown on exit. #129

Closed pento closed 5 years ago

pento commented 5 years ago

TestPress will spawn a process running docker-compose down on exit, but there's a race condition between that process triggering the containers to shutdown, and Node killing off its child processes.

By defining this process as being detached (and not attaching to any IO streams), it will survive Node quitting, so that the containers will actually be shutdown.

Testing

> cd ~/Library/Application Support/testpress/tools
> docker-compose ps

Prior to this PR, the containers would often still be running. After this PR, not so much.