Hey there, I am new to Pact testing and am trying ...
# pact-jvm
h
Hey there, I am new to Pact testing and am trying to write consumer side contract testing on our java SpringBoot application for graphql resquests The problem I am facing is that when I run all the tests it fails on some of the test on using static port. I assume it takes time to shutdown the previous mock connection and start new. Using a dynamic port works. I am trying to avoid using dynamic port. I have tried
Executor.closeIdleConnections();
with @afterEach tests but that doesnt work. Can someone please help with alternative solution to tear down the connection after each tests (edited)
m
Why are you trying to avoid using a dynamic port? (that would be recommended) What error are you getting, exactly?
h
I am trying to avoid for any resource related issue for when the tests count increases with time. This error was displayed :
feign.RetryableException: An established connection was aborted by the software in your host machine executing POST
Setting the system variable "`pact.mockserver.addCloseHeader"` true worked for me
m
Ok. Yeah that's the way to resolve persistent connections