Skip to content

Commit 8bd3fd8

Browse files
moscherjernst
andauthored
Skip security manager hack test on jdk 24+ (#122070) (#123465)
This test only makes sense when security manager is actually available. This commit skips the test otherwise. closes #121871 (cherry picked from commit 57c2a7e) Co-authored-by: Ryan Ernst <[email protected]>
1 parent 72f9683 commit 8bd3fd8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/src/test/java/org/elasticsearch/bootstrap/NoSecurityManagerTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
1313

1414
import org.apache.lucene.tests.util.LuceneTestCase;
15+
import org.elasticsearch.jdk.RuntimeVersionFeature;
1516
import org.elasticsearch.test.GraalVMThreadsFilter;
1617

1718
import static org.hamcrest.Matchers.is;
@@ -20,6 +21,7 @@
2021
public class NoSecurityManagerTests extends LuceneTestCase {
2122

2223
public void testPrepopulateSecurityCaller() {
24+
assumeTrue("security manager must be available", RuntimeVersionFeature.isSecurityManagerAvailable());
2325
assumeTrue("Unexpected security manager:" + System.getSecurityManager(), System.getSecurityManager() == null);
2426
boolean isAtLeastJava17 = Runtime.version().feature() >= 17;
2527
boolean isPrepopulated = Security.prepopulateSecurityCaller();

0 commit comments

Comments
 (0)