From 456e42b05b2fa8b0f5cc4eb0e6b65e3e1bc84e85 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 18 Oct 2024 22:31:53 +1100 Subject: [PATCH] remove shuffle --- .../Netty4IncrementalRequestHandlingIT.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/modules/transport-netty4/src/internalClusterTest/java/org/elasticsearch/http/netty4/Netty4IncrementalRequestHandlingIT.java b/modules/transport-netty4/src/internalClusterTest/java/org/elasticsearch/http/netty4/Netty4IncrementalRequestHandlingIT.java index 4048420e55ba8..973250a5fa3d4 100644 --- a/modules/transport-netty4/src/internalClusterTest/java/org/elasticsearch/http/netty4/Netty4IncrementalRequestHandlingIT.java +++ b/modules/transport-netty4/src/internalClusterTest/java/org/elasticsearch/http/netty4/Netty4IncrementalRequestHandlingIT.java @@ -43,7 +43,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.common.Randomness; import org.elasticsearch.common.bytes.ReleasableBytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.ClusterSettings; @@ -73,7 +72,6 @@ import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.transport.netty4.Netty4Utils; -import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.concurrent.BlockingDeque; @@ -179,18 +177,12 @@ public void testClientConnectionCloseMidStream() throws Exception { assertFalse(handler.streamClosed); - final List runnables = new ArrayList<>( - List.of( - // terminate client connection - ctx.clientChannel::close, - // read the first half of the request - handler.stream::next, - // attempt to read more data and it should notice channel being closed eventually - handler.stream::next - ) - ); - Randomness.shuffle(runnables); - runnables.forEach(Runnable::run); + // terminate client connection + ctx.clientChannel.close(); + // read the first half of the request + handler.stream.next(); + // attempt to read more data and it should notice channel being closed eventually + handler.stream.next(); assertBusy(() -> { assertNull(handler.stream.buf());