-
Notifications
You must be signed in to change notification settings - Fork 62
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
tearDownHttpMock fails when test runs in isolation #51
Comments
Very interesting case. It seems like for some reason the test server is attempted to start more than once and the second attempt fails, that’s what the log message is telling me. Can you add some logging to file_put_contents('/tmp/http-mock.log', (new \Exception)->getTraceAsString(), FILE_APPEND); If you could attach the trace here, that would be lovely. |
I put the logging code here public function start(callable $callback = null, array $env = [])
{
parent::start($callback, $env);
file_put_contents('/tmp/http-mock.log', (new \Exception)->getTraceAsString(), FILE_APPEND);
$this->pollWait();
} And executed the test twice by running The first time I removed This is the log
I hope it helps 😄 |
I have got a simple test for a gateway. Everything goes fine while the test is not ran in a separateProcess
But If I add the runInSeparateProcess annotation, then
tearDownHttpMock
fails$server->getIncrementalErrorOutput()
returns[Wed Apr 3 16:52:26 2019] Failed to listen on 127.0.0.1:33371 (reason: Address already in use)
As workaround I override the method into my test class
But I guess if there is another (better/proper) way to do this
The text was updated successfully, but these errors were encountered: