Skip to content

Commit

Permalink
Mute disruption tests for jdk20+ (#94207)
Browse files Browse the repository at this point in the history
In JDK 20 Thread suspend/resume is soft removed (they now throw
UnsupportedOperationException). Many ES disruption tests simulate GC
pauses with suspend/resume. As that strategy will no longer work, this
commit mutes those tests for jdk20+.

relates #94206
closes #93707
  • Loading branch information
rjernst authored Mar 1, 2023
1 parent 92566ba commit 7ab1ad7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ private void testFollowerCheckerAfterMasterReelection(NetworkLinkDisruptionType
* following another elected master node. These nodes should reject this cluster state and prevent them from following the stale master.
*/
public void testStaleMasterNotHijackingMajority() throws Exception {
assumeFalse("jdk20 removed thread suspend/resume", Runtime.version().feature() >= 20);
final List<String> nodes = internalCluster().startNodes(
3,
Settings.builder()
Expand Down Expand Up @@ -333,6 +334,7 @@ public void onFailure(Exception e) {
* @throws Exception
*/
public void testRepeatedMasterChanges(String expectedMasterStabilitySymptomSubstring) throws Exception {
assumeFalse("jdk20 removed thread suspend/resume", Runtime.version().feature() >= 20);
final List<String> nodes = internalCluster().startNodes(
3,
Settings.builder()
Expand Down Expand Up @@ -422,6 +424,7 @@ public void testRepeatedMasterChanges(String expectedMasterStabilitySymptomSubst
}

public void testRepeatedNullMasterRecognizedAsGreenIfMasterDoesNotKnowItIsUnstable() throws Exception {
assumeFalse("jdk20 removed thread suspend/resume", Runtime.version().feature() >= 20);
/*
* In this test we have a single master-eligible node. We pause it repeatedly (simulating a long GC pause for example) so that
* other nodes decide it is no longer the master. However since there is no other master-eligible node, another node is never
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import org.elasticsearch.core.Nullable;
import org.elasticsearch.test.ESTestCase;
import org.junit.BeforeClass;

import java.lang.management.ThreadInfo;
import java.util.ArrayList;
Expand Down Expand Up @@ -40,6 +41,11 @@ public void executeLocked(Runnable r) {
}
}

@BeforeClass
public static void ignoreJdk20Plus() {
assumeFalse("jdk20 removed thread suspend/resume", Runtime.version().feature() >= 20);
}

public void testBlockingTimeout() throws Exception {
final String nodeName = "test_node";
LongGCDisruption disruption = new LongGCDisruption(random(), nodeName) {
Expand Down

0 comments on commit 7ab1ad7

Please sign in to comment.