Skip to content

Commit

Permalink
#7318 disable assertion for H3 as it's not a valid assertion for UDP
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <[email protected]>
(cherry picked from commit e4140e2)
  • Loading branch information
lorban authored and joakime committed Feb 25, 2022
1 parent 7b4b57b commit 0905588
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,14 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r
assertTrue(clientLatch.await(count, TimeUnit.SECONDS));
assertEquals(count, remotePorts.size());

// Unix Domain does not have ports.
if (transport == Transport.UNIX_DOMAIN)
return;

// UDP does not have TIME_WAIT so ports may be reused by different connections.
if (transport == Transport.H3)
return;

// Maps {remote_port -> number_of_times_port_was_used}.
Map<Integer, Long> results = remotePorts.stream()
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
Expand All @@ -257,7 +265,6 @@ protected void service(String target, Request jettyRequest, HttpServletRequest r
// [p1, p2, p3 | p1, p2, p3 | p4, p4, p5 | p6, p5, p7]
// Opening p5 and p6 was delayed, so the opening of p7 was triggered
// to replace p4 while p5 and p6 were busy sending their requests.
if (transport != Transport.UNIX_DOMAIN)
assertThat(remotePorts.toString(), results.size(), lessThanOrEqualTo(count / maxUsage));
assertThat(results.toString(), count / maxUsage, lessThanOrEqualTo(results.size()));
}
}

0 comments on commit 0905588

Please sign in to comment.