-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Disable autoscaling capacity test on debian 8 #67159
Conversation
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
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, "."); |
There was a problem hiding this comment.
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"))
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed in 2943006
There was a problem hiding this 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"); |
There was a problem hiding this comment.
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();
There was a problem hiding this comment.
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
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 #67089
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
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
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
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