diff --git a/server/src/test/java/org/elasticsearch/transport/TcpTransportTests.java b/server/src/test/java/org/elasticsearch/transport/TcpTransportTests.java index f3e4ef46a71..537385687c6 100644 --- a/server/src/test/java/org/elasticsearch/transport/TcpTransportTests.java +++ b/server/src/test/java/org/elasticsearch/transport/TcpTransportTests.java @@ -206,7 +206,9 @@ public class TcpTransportTests extends ESTestCase { @Override public NodeChannels openConnection(DiscoveryNode node, ConnectionProfile connectionProfile) { - assertTrue(connectionProfile.getCompressionEnabled()); + if (compressed) { + assertTrue(connectionProfile.getCompressionEnabled()); + } int numConnections = connectionProfile.getNumConnections(); ArrayList fakeChannels = new ArrayList<>(numConnections); for (int i = 0; i < numConnections; ++i) {