Skip to content

Commit

Permalink
Mute disruption tests for jdk20+ (#94207) (#94254)
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 8d40b1a commit 8113c92
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 @@ -22,6 +22,7 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.set.Sets;
import org.elasticsearch.core.Tuple;
import org.elasticsearch.jdk.JavaVersion;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.disruption.LongGCDisruption;
Expand Down Expand Up @@ -172,6 +173,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", JavaVersion.current().compareTo(JavaVersion.parse("20")) >= 0);
final List<String> nodes = internalCluster().startNodes(
3,
Settings.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
package org.elasticsearch.test.disruption;

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

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

@BeforeClass
public static void ignoreJdk20Plus() {
assumeFalse("jdk20 removed thread suspend/resume", JavaVersion.current().compareTo(JavaVersion.parse("20")) >= 0);
}

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

0 comments on commit 8113c92

Please sign in to comment.