-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Pact consumer tests' execution hangs after reaching 200 connection limit of mockServer #658
Comments
Are you running the 222 tests in the same test class, or as part of a suite of tests? |
Thanks, I'll look into this. It might be related to #342, in that the |
This is not an issue with the MockServer, but with the Apache Http PoolingHttpClientConnectionManager. See 2.5. Connection eviction policy of https://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html for more information. At the end of your test, you'll need to call |
Thanks, I’ll try this out. I’m not using the
PoolingHttpClientConnectionManager in the tests, and I have observed the
connection starting when I step into runConsumerTest(pact, config,
mockServer -> {} even before it reaches the code inside {}. I thought I
saw the PoolingHttpClientConnectionManager Being used in the mockServer
which is why I mentioned I was able to trace the issue to the mockServer.
Thanks again!
…On Sun, 3 Jun 2018 at 4:22 PM Ronald Holshausen ***@***.***> wrote:
This is not an issue with the MockServer, but with the Apache Http
PoolingHttpClientConnectionManager. See 2.5. Connection eviction policy of
https://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html
for more information.
At the end of your test, you'll need to call
ClientConnectionManager#closeExpiredConnections() or don't use the
PoolingHttpClientConnectionManager in your tests (if possible).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#658 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AbEp28hTPLaIOHDiUHWzO1saUw75ns9dks5t42SQgaJpZM4S_mtk>
.
|
Hmm, now that you mention it, there is a bootup check run from that function. I'll check to see if that is using the PoolingHttpClientConnectionManager. |
I think this is the culprit: https://github.com/DiUS/pact-jvm/blob/master/pact-jvm-consumer/src/main/kotlin/au/com/dius/pact/consumer/MockHttpServer.kt#L200 I'll fix that function to use a better connection manager. |
Fix has been released with version 3.5.18 |
When running the pact consumer tests, the execution hangs after completing 200 tests (we got 222 tests to run). It seemed a bit odd that it'll stop after 200 tests but found this in the console:
I was able to trace this to the mockServer. It doesn't seem to close the connection after each test. Is there a way to close the connection after each test? Thanks!
The text was updated successfully, but these errors were encountered: