Open kapoora opened 8 years ago
Weird. If Moco server is not ready, client should receive Connection refused
.
Could you please provide your complete test case?
I have the same issue ...
This may caused by the stale connection state of http client has a connection manager with a connection pool, like apache httpclient.
The moco server has already passed running(server, ...); part, then it will called to stop, to close all the channels and connections associated with it. But the connection pool is still wait to finish the connection. So before the client connection gracefully closed, the client send a request through that connection again, and caused the "connection refused" exception.
To avoid this issue, one thing can be checked if there is any possible that the 'client' has been reused
I think my test cases are running before the mock server starts due to which it fails with 'Connection reset; nested exception is java.net.SocketException: Connection reset'
if i make the thread sleep for 1000/3000 ms in setup method it works fine. Looking for some method which can confirm the server started and acceptation connection.
Gradle
Test Case