99
1010package org .elasticsearch .transport ;
1111
12+ import org .apache .logging .log4j .Level ;
1213import org .elasticsearch .Build ;
1314import org .elasticsearch .TransportVersion ;
1415import org .elasticsearch .cluster .node .DiscoveryNodeUtils ;
1920import org .elasticsearch .common .util .PageCacheRecycler ;
2021import org .elasticsearch .indices .breaker .NoneCircuitBreakerService ;
2122import org .elasticsearch .test .ESTestCase ;
23+ import org .elasticsearch .test .MockLog ;
2224import org .elasticsearch .test .transport .MockTransportService ;
2325import org .elasticsearch .threadpool .TestThreadPool ;
2426import 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