-
-
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
Tests concerning PUTs can't coexist with other JUnit 5 tests with pact-jvm-consumer-junit5_2.12 #728
Comments
Hi @paulspencerwilliams , |
Hey @minhdoan159, a colleague also discovered the timeout hack, and we've temporarily worked around this issue using |
Thanks for the example project! My guess is that this is related to the RestTemplate using a connection cache (see #342 for a similar issue). As each test gets a new mock server, any cached connection on the second test will be stale. A five second sleep might be enough time for the RestTemplate HTTP connection library to get a new connection. Changing the test to use a different port for each test passes. |
Hi guys, just had the same issue with HTTP PATCH, so not only PUT |
It won't be dependent on the HTTP method, but on how the HTTP client library caches the connection. |
It would appear that having consumer code that issue PUT requests on Pact's mock server cause issues if tests co-exist in the same JUnit test class.
I've created a simple exemplar project to replicate this issue. To replicate, follow these instructions:
The second test on the works-with-posts branch would appear to prove this is PUT related.
The text was updated successfully, but these errors were encountered: