|
22 | 22 | import org.elasticsearch.common.settings.Settings; |
23 | 23 | import org.elasticsearch.common.util.PageCacheRecycler; |
24 | 24 | import org.elasticsearch.core.Releasable; |
25 | | -import org.elasticsearch.core.SuppressForbidden; |
26 | 25 | import org.elasticsearch.core.TimeValue; |
27 | 26 | import org.elasticsearch.index.IndexVersion; |
28 | 27 | import org.elasticsearch.index.IndexVersions; |
@@ -373,40 +372,32 @@ public void testRejectsMismatchedBuildHash() { |
373 | 372 | assertFalse(transportServiceA.nodeConnected(discoveryNode)); |
374 | 373 | } |
375 | 374 |
|
376 | | - @SuppressForbidden(reason = "Sets property for testing") |
377 | 375 | public void testAcceptsMismatchedServerlessBuildHash() { |
378 | 376 | assumeTrue("Current build needs to be a snapshot", Build.current().isSnapshot()); |
379 | | - assumeTrue("Security manager needs to be disabled", System.getSecurityManager() == null); |
380 | | - System.setProperty(TransportService.SERVERLESS_TRANSPORT_SYSTEM_PROPERTY, Boolean.TRUE.toString()); // security manager blocks |
381 | | - // this |
382 | | - try { |
383 | | - final DisruptingTransportInterceptor transportInterceptorA = new DisruptingTransportInterceptor(); |
384 | | - final DisruptingTransportInterceptor transportInterceptorB = new DisruptingTransportInterceptor(); |
385 | | - transportInterceptorA.setModifyBuildHash(true); |
386 | | - transportInterceptorB.setModifyBuildHash(true); |
387 | | - final Settings settings = Settings.builder() |
388 | | - .put("cluster.name", "a") |
389 | | - .put(IGNORE_DESERIALIZATION_ERRORS_SETTING.getKey(), true) // suppress assertions to test production error-handling |
390 | | - .build(); |
391 | | - final TransportService transportServiceA = startServices( |
392 | | - "TS_A", |
393 | | - settings, |
394 | | - TransportVersion.current(), |
395 | | - VersionInformation.CURRENT, |
396 | | - transportInterceptorA |
397 | | - ); |
398 | | - final TransportService transportServiceB = startServices( |
399 | | - "TS_B", |
400 | | - settings, |
401 | | - TransportVersion.current(), |
402 | | - VersionInformation.CURRENT, |
403 | | - transportInterceptorB |
404 | | - ); |
405 | | - AbstractSimpleTransportTestCase.connectToNode(transportServiceA, transportServiceB.getLocalNode(), TestProfiles.LIGHT_PROFILE); |
406 | | - assertTrue(transportServiceA.nodeConnected(transportServiceB.getLocalNode())); |
407 | | - } finally { |
408 | | - System.clearProperty(TransportService.SERVERLESS_TRANSPORT_SYSTEM_PROPERTY); |
409 | | - } |
| 377 | + final DisruptingTransportInterceptor transportInterceptorA = new DisruptingTransportInterceptor(); |
| 378 | + final DisruptingTransportInterceptor transportInterceptorB = new DisruptingTransportInterceptor(); |
| 379 | + transportInterceptorA.setModifyBuildHash(true); |
| 380 | + transportInterceptorB.setModifyBuildHash(true); |
| 381 | + final Settings settings = Settings.builder() |
| 382 | + .put("cluster.name", "a") |
| 383 | + .put(IGNORE_DESERIALIZATION_ERRORS_SETTING.getKey(), true) // suppress assertions to test production error-handling |
| 384 | + .build(); |
| 385 | + final TransportService transportServiceA = startServices( |
| 386 | + "TS_A", |
| 387 | + settings, |
| 388 | + TransportVersion.current(), |
| 389 | + VersionInformation.CURRENT, |
| 390 | + transportInterceptorA |
| 391 | + ); |
| 392 | + final TransportService transportServiceB = startServices( |
| 393 | + "TS_B", |
| 394 | + settings, |
| 395 | + TransportVersion.current(), |
| 396 | + VersionInformation.CURRENT, |
| 397 | + transportInterceptorB |
| 398 | + ); |
| 399 | + AbstractSimpleTransportTestCase.connectToNode(transportServiceA, transportServiceB.getLocalNode(), TestProfiles.LIGHT_PROFILE); |
| 400 | + assertTrue(transportServiceA.nodeConnected(transportServiceB.getLocalNode())); |
410 | 401 | } |
411 | 402 |
|
412 | 403 | public void testAcceptsMismatchedBuildHashFromDifferentVersion() { |
|
0 commit comments