Skip to content

Commit

Permalink
[7.x] Re-enable tests that were failing due to JDK memory bug on Debi…
Browse files Browse the repository at this point in the history
…an8 (#72125)
  • Loading branch information
danhermann committed Apr 22, 2021
1 parent f9daaaf commit 7cc0329
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 35 deletions.
Expand Up @@ -47,7 +47,6 @@
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
import org.elasticsearch.action.support.DestructiveOperations;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.bootstrap.JavaVersion;
import org.elasticsearch.client.AdminClient;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.ClusterAdminClient;
Expand Down Expand Up @@ -124,7 +123,6 @@
import org.elasticsearch.indices.IndicesRequestCache;
import org.elasticsearch.indices.store.IndicesStore;
import org.elasticsearch.ingest.IngestMetadata;
import org.elasticsearch.monitor.os.OsInfo;
import org.elasticsearch.node.NodeMocksPlugin;
import org.elasticsearch.plugins.NetworkPlugin;
import org.elasticsearch.plugins.Plugin;
Expand Down Expand Up @@ -2430,22 +2428,4 @@ public Settings onNodeStopped(String nodeName) throws Exception {
}
});
}

/**
* On Debian 8 the "memory" subsystem is not mounted by default
* when cgroups are enabled, and this confuses many versions of
* Java prior to Java 15. Tests that rely on machine memory
* being accurately determined will not work on such setups,
* and can use this method for selective muting.
* See https://github.com/elastic/elasticsearch/issues/67089
* and https://github.com/elastic/elasticsearch/issues/66885
*/
protected boolean willSufferDebian8MemoryProblem() {
final NodesInfoResponse response = client().admin().cluster().prepareNodesInfo().execute().actionGet();
final boolean anyDebian8Nodes = response.getNodes()
.stream()
.anyMatch(ni -> ni.getInfo(OsInfo.class).getPrettyName().equals("Debian GNU/Linux 8 (jessie)"));
boolean java15Plus = JavaVersion.current().compareTo(JavaVersion.parse("15")) >= 0;
return anyDebian8Nodes && java15Plus == false;
}
}
Expand Up @@ -34,9 +34,6 @@
public class TransportGetAutoscalingCapacityActionIT extends AutoscalingIntegTestCase {

public void testCurrentCapacity() throws Exception {
// see: https://github.com/elastic/elasticsearch/issues/67089#issuecomment-756114654
assumeFalse("cannot run on debian 8 prior to java 15", willSufferDebian8MemoryProblem());

assertThat(capacity().results().keySet(), Matchers.empty());
long memory = OsProbe.getInstance().getTotalPhysicalMemorySize();
long storage = internalCluster().getInstance(NodeEnvironment.class).nodePaths()[0].fileStore.getTotalSpace();
Expand Down
Expand Up @@ -452,10 +452,6 @@ public void testMlStateAndResultsIndicesNotAvailable() throws Exception {
}

public void testCloseUnassignedLazyJobAndDatafeed() throws Exception {

// see: https://github.com/elastic/elasticsearch/issues/66885#issuecomment-758790179
assumeFalse("cannot run on debian 8 prior to java 15", willSufferDebian8MemoryProblem());

internalCluster().ensureAtLeastNumDataNodes(3);
ensureStableCluster(3);

Expand Down
Expand Up @@ -410,10 +410,6 @@ public void testStopAndForceStopDatafeed() throws Exception {
}

public void testJobRelocationIsMemoryAware() throws Exception {

// see: https://github.com/elastic/elasticsearch/issues/66885#issuecomment-758790179
assumeFalse("cannot run on debian 8 prior to java 15", willSufferDebian8MemoryProblem());

internalCluster().ensureAtLeastNumDataNodes(1);
ensureStableCluster();

Expand Down
Expand Up @@ -127,14 +127,10 @@ public void testLazyNodeValidation() throws Exception {
}

public void testSingleNode() throws Exception {
// see: https://github.com/elastic/elasticsearch/issues/66885#issuecomment-758790179
assumeFalse("cannot run on debian 8 prior to java 15", willSufferDebian8MemoryProblem());
verifyMaxNumberOfJobsLimit(1, randomIntBetween(1, 20), randomBoolean());
}

public void testMultipleNodes() throws Exception {
// see: https://github.com/elastic/elasticsearch/issues/66885#issuecomment-758790179
assumeFalse("cannot run on debian 8 prior to java 15", willSufferDebian8MemoryProblem());
verifyMaxNumberOfJobsLimit(3, randomIntBetween(1, 20), randomBoolean());
}

Expand Down

0 comments on commit 7cc0329

Please sign in to comment.