Closed vitormattos closed 3 years ago
You can see from the failed integration tests that isRunning
doesn't mean it's ready to accept incoming connections, just that the process id exists.
isRunning
will return true at any point after the call to exec
on line 79 unless the server otherwise crashes.
Being able to tell when the server is actually able to accept connections is a bigger ask.
I'd love to see a reduction in the time, but it would require a larger more systemic change.
Sorry for not checking the continuous integration output, I only tested it on the application I'm using your package.
I added a health check.
With this new approach sleep can even be removed or further reduced and keep the health check in a loop for 1 second. What do you think?
I pushed to your branch what I think is probably a simpler solution. Thoughts?
@vitormattos I just want to say thank you for this!
I just tried it on a big project I personally use mock-webserver on and it knocked phpunit from ~15 seconds down to 1.75 total, so that's a pretty decent win.
This is the power of FLOSS projects!
I used microseconds to enable testing at shorter intervals. On the first run there is no sleep. In the second run, sleep is half a second. Repetitions are made for 1 and a half seconds.