Skip to content

Commit

Permalink
Merge pull request #9008 from eclipse/fix/jetty-10-9005-flaky-Connect…
Browse files Browse the repository at this point in the history
…ionPoolTest

Fixes #9005 - Flaky test ConnectionPoolTest.testConcurrentRequestsAllBlockedOnServer
  • Loading branch information
joakime authored Dec 6, 2022
2 parents 390abcc + f122e75 commit 486b51e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,15 @@ public void resolve(String host, int port, Promise<List<InetSocketAddress>> prom
@MethodSource("pools")
public void testConcurrentRequestsAllBlockedOnServerWithLargeConnectionPool(ConnectionPoolFactory factory) throws Exception
{
int count = 50;
int count = 10;
testConcurrentRequestsAllBlockedOnServer(factory, count, 2 * count);
}

@ParameterizedTest
@MethodSource("pools")
public void testConcurrentRequestsAllBlockedOnServerWithExactConnectionPool(ConnectionPoolFactory factory) throws Exception
{
int count = 50;
int count = 10;
testConcurrentRequestsAllBlockedOnServer(factory, count, count);
}

Expand Down Expand Up @@ -441,10 +441,12 @@ protected void service(String target, org.eclipse.jetty.server.Request jettyRequ
{
if (result.isSucceeded())
latch.countDown();
else
result.getFailure().printStackTrace();
}));
}

assertTrue(latch.await(5, TimeUnit.SECONDS), "server requests " + barrier.getNumberWaiting() + "<" + count + " - client: " + client.dump());
assertTrue(latch.await(15, TimeUnit.SECONDS), "server requests " + barrier.getNumberWaiting() + "<" + count + " - client: " + client.dump());
List<Destination> destinations = client.getDestinations();
assertEquals(1, destinations.size());
// The max duration connection pool aggressively closes expired connections upon release, which interferes with this assertion.
Expand Down

0 comments on commit 486b51e

Please sign in to comment.