I am generating a rather large pact file. A parameterized test appends a single interaction to the pact file for every line in a csv document.
Unfortunately, the mockserver created with the @Rule PactProviderRuleMk2 locks up after 200 tests when it hits the connection limit. Apparently, connections are not torn down. For less than two hundred test cases, the system works perfectly.
Is there any way to increase the connection limit for the mockserver, reduce the number of connections or close the connections?
@RunWith(Parameterized.class)
public class PactGenerator {
private static final Map<String, Testfall> TESTCASES = readTestfallFile();
@Rule
public PactProviderRuleMk2 mockProvider = new PactProviderRuleMk2(PROVIDER, this);
@Parameterized.Parameters
public static Collection<Object[]> data() {
// populates TESTCASES
}
@Parameterized.Parameter
public String key;
@Pact(consumer = CONSUMER)
public RequestResponsePact pact(PactDslWithProvider builder) {
return createPact(builder, key);
}
@Test
@PactVerification(value = PROVIDER)
public void test() throws IOException {
runTests(key);
}
}