Skip to content

Commit 7c9ffc2

Browse files
committed
Make test actually fail without sysprop and then make it pass again
1 parent 7327426 commit 7c9ffc2

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

qa/serverless-system-properties/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import org.apache.tools.ant.filters.ReplaceTokens
11-
1210
apply plugin: 'elasticsearch.build'
1311

1412
dependencies {
@@ -18,5 +16,5 @@ dependencies {
1816

1917
tasks.named("test").configure {
2018
systemProperty 'es.stateless.allow.index.refresh_interval.override', 'true'
21-
// systemProperty 'es.serverless_transport', 'true'
19+
systemProperty 'es.serverless_transport', 'true'
2220
}

qa/serverless-system-properties/src/test/java/org/elasticsearch/transport/ServerlessTransportHandshakeTests.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package org.elasticsearch.transport;
1111

12+
import org.apache.logging.log4j.Level;
1213
import org.elasticsearch.Build;
1314
import org.elasticsearch.TransportVersion;
1415
import org.elasticsearch.cluster.node.DiscoveryNodeUtils;
@@ -19,6 +20,7 @@
1920
import org.elasticsearch.common.util.PageCacheRecycler;
2021
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
2122
import org.elasticsearch.test.ESTestCase;
23+
import org.elasticsearch.test.MockLog;
2224
import org.elasticsearch.test.transport.MockTransportService;
2325
import org.elasticsearch.threadpool.TestThreadPool;
2426
import org.elasticsearch.threadpool.ThreadPool;
@@ -94,7 +96,7 @@ public static void terminateThreadPool() {
9496
threadPool = null;
9597
}
9698

97-
public void testAcceptsMismatchedServerlessBuildHash() {
99+
public void testAcceptsMismatchedServerlessBuildHashWithoutWarning() {
98100
assumeTrue("Current build needs to be a snapshot", Build.current().isSnapshot());
99101
final var transportInterceptorA = new BuildHashModifyingTransportInterceptor();
100102
final var transportInterceptorB = new BuildHashModifyingTransportInterceptor();
@@ -104,8 +106,14 @@ public void testAcceptsMismatchedServerlessBuildHash() {
104106
.build();
105107
final TransportService transportServiceA = startServices("TS_A", settings, transportInterceptorA);
106108
final TransportService transportServiceB = startServices("TS_B", settings, transportInterceptorB);
107-
AbstractSimpleTransportTestCase.connectToNode(transportServiceA, transportServiceB.getLocalNode(), TestProfiles.LIGHT_PROFILE);
108-
assertTrue(transportServiceA.nodeConnected(transportServiceB.getLocalNode()));
109+
MockLog.assertThatLogger(() -> {
110+
AbstractSimpleTransportTestCase.connectToNode(transportServiceA, transportServiceB.getLocalNode(), TestProfiles.LIGHT_PROFILE);
111+
assertTrue(transportServiceA.nodeConnected(transportServiceB.getLocalNode()));
112+
},
113+
TransportService.class,
114+
new MockLog.UnseenEventExpectation("incompatible wire format log", TransportService.class.getCanonicalName(), Level.WARN, "*")
115+
);
116+
109117
}
110118

111119
}

0 commit comments

Comments
 (0)