Skip to content
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

Disable autoscaling capacity test on debian 8 #67159

Conversation

henningandersen
Copy link
Contributor

Prior to java 15, ES running on debian 8 will report 0 memory of host,
therefore this test cannot run on debian 8.

Relates #67089

Prior to java 15, ES running on debian 8 will report 0 memory of host,
therefore this test cannot run on debian 8.

Relates elastic#67089
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Jan 7, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

public void testCurrentCapacity() throws Exception {
boolean looksLikeDebian8 = Constants.LINUX && Constants.OS_VERSION.startsWith("3.16.0");
final StringTokenizer st = new StringTokenizer(JVM_SPEC_VERSION, ".");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have JavaVersion.CURRENT.compareTo(JavaVersion.parse("15")).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed in 2943006

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I'm really sorry, I didn't mean to leave the Java version comment as a single comment, I had another one for you and I meant to submit them in a batch so you didn't have to react twice, wrong button, 😞. I left that additional comment, up to you either way.

public void testCurrentCapacity() throws Exception {
boolean looksLikeDebian8 = Constants.LINUX && Constants.OS_VERSION.startsWith("3.16.0");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can be annoyingly precise here 😇:

diff --git a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/action/TransportGetAutoscalingCapacityActionIT.java b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/action/TransportGetAutoscalingCapacityActionIT.java
index e0ec9b63bff..c75c9fbbc11 100644
--- a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/action/TransportGetAutoscalingCapacityActionIT.java
+++ b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/action/TransportGetAutoscalingCapacityActionIT.java
@@ -6,9 +6,10 @@
 
 package org.elasticsearch.xpack.autoscaling.action;
 
-import org.apache.lucene.util.Constants;
+import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
 import org.elasticsearch.bootstrap.JavaVersion;
 import org.elasticsearch.env.NodeEnvironment;
+import org.elasticsearch.monitor.os.OsInfo;
 import org.elasticsearch.monitor.os.OsProbe;
 import org.elasticsearch.test.ESIntegTestCase;
 import org.elasticsearch.xpack.autoscaling.AutoscalingIntegTestCase;
@@ -26,10 +27,12 @@ import static org.hamcrest.Matchers.greaterThan;
 public class TransportGetAutoscalingCapacityActionIT extends AutoscalingIntegTestCase {
 
     public void testCurrentCapacity() throws Exception {
-        boolean looksLikeDebian8 = Constants.LINUX && Constants.OS_VERSION.startsWith("3.16.0");
+        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;
         // see: https://github.com/elastic/elasticsearch/issues/67089#issuecomment-756114654
-        assumeTrue("cannot run on debian 8 prior to java 15", java15Plus || looksLikeDebian8 == false);
+        assumeTrue("cannot run on debian 8 prior to java 15", java15Plus || anyDebian8Nodes == false);
 
         assertThat(capacity().results().keySet(), Matchers.empty());
         long memory = OsProbe.getInstance().getTotalPhysicalMemorySize();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, precise is good, used your version in 90fad32

@henningandersen henningandersen merged commit ad27575 into elastic:master Jan 8, 2021
henningandersen added a commit that referenced this pull request Jan 8, 2021
Prior to java 15, ES running on debian 8 will report 0 memory of host,
therefore this test cannot run on debian 8.

Relates #67089
henningandersen added a commit that referenced this pull request Jan 8, 2021
Prior to java 15, ES running on debian 8 will report 0 memory of host,
therefore this test cannot run on debian 8.

Relates #67089
droberts195 added a commit that referenced this pull request Jan 13, 2021
The selective muting implemented for autoscaling in #67159
is extended to the ML tests that also fail when machine
memory is reported as 0.

Most of the logic to determine when memory will not be
accurately reported is now in a utility method in the
base class.

Relates #66885
droberts195 added a commit to droberts195/elasticsearch that referenced this pull request Jan 13, 2021
The selective muting implemented for autoscaling in elastic#67159
is extended to the ML tests that also fail when machine
memory is reported as 0.

Most of the logic to determine when memory will not be
accurately reported is now in a utility method in the
base class.

Relates elastic#66885
Backport of elastic#67422
droberts195 added a commit to droberts195/elasticsearch that referenced this pull request Jan 13, 2021
The selective muting implemented for autoscaling in elastic#67159
is extended to the ML tests that also fail when machine
memory is reported as 0.

Most of the logic to determine when memory will not be
accurately reported is now in a utility method in the
base class.

Relates elastic#66885
Backport of elastic#67422
droberts195 added a commit to droberts195/elasticsearch that referenced this pull request Jan 13, 2021
The selective muting implemented for autoscaling in elastic#67159
is extended to the ML tests that also fail when machine
memory is reported as 0.

Most of the logic to determine when memory will not be
accurately reported is now in a utility method in the
base class.

Relates elastic#66885
Backport of elastic#67422
droberts195 added a commit that referenced this pull request Jan 13, 2021
The selective muting implemented for autoscaling in #67159
is extended to the ML tests that also fail when machine
memory is reported as 0.

Most of the logic to determine when memory will not be
accurately reported is now in a utility method in the
base class.

Relates #66885
Backport of #67422
droberts195 added a commit that referenced this pull request Jan 13, 2021
The selective muting implemented for autoscaling in #67159
is extended to the ML tests that also fail when machine
memory is reported as 0.

Most of the logic to determine when memory will not be
accurately reported is now in a utility method in the
base class.

Relates #66885
Backport of #67422
droberts195 added a commit that referenced this pull request Jan 13, 2021
The selective muting implemented for autoscaling in #67159
is extended to the ML tests that also fail when machine
memory is reported as 0.

Most of the logic to determine when memory will not be
accurately reported is now in a utility method in the
base class.

Relates #66885
Backport of #67422
droberts195 added a commit that referenced this pull request Jan 13, 2021
The selective muting implemented for autoscaling in #67159
is extended to the ML tests that also fail when machine
memory is reported as 0.

Most of the logic to determine when memory will not be
accurately reported is now in a utility method in the
base class.

Relates #66885
Backport of #67422
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Autoscaling Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. >test Issues or PRs that are addressing/adding tests v7.11.1 v7.12.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants