Skip to content

[7.13] Re-enable tests that were failing due to JDK memory bug on Debian8 #72126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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;
}
}
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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