From d08944b1ff437a78542e4d33aea2cdfee07d9649 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Fri, 1 Dec 2017 11:12:55 +0000 Subject: [PATCH] [TEST] Fix seed-specific failure in ML node allocation test This was due to a hardcoded job ID that wouldn't exist when two random numbers generated by the test framework were both small. Original commit: elastic/x-pack-elasticsearch@9529e6d28034d04facde30bd889aeb8f4ccf3b6e --- .../org/elasticsearch/xpack/ml/action/OpenJobActionTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/src/test/java/org/elasticsearch/xpack/ml/action/OpenJobActionTests.java b/plugin/src/test/java/org/elasticsearch/xpack/ml/action/OpenJobActionTests.java index 997cb73cf34..ea5693e4858 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/ml/action/OpenJobActionTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/ml/action/OpenJobActionTests.java @@ -192,7 +192,7 @@ public class OpenJobActionTests extends ESTestCase { metaData.putCustom(PersistentTasksCustomMetaData.TYPE, tasks); cs.metaData(metaData); cs.routingTable(routingTable.build()); - Assignment result = OpenJobAction.selectLeastLoadedMlNode("job_id2", cs.build(), 2, maxRunningJobsPerNode, 30, logger); + Assignment result = OpenJobAction.selectLeastLoadedMlNode("job_id0", cs.build(), 2, maxRunningJobsPerNode, 30, logger); assertNull(result.getExecutorNode()); assertTrue(result.getExplanation().contains("because this node is full. Number of opened jobs [" + maxRunningJobsPerNode + "], xpack.ml.max_open_jobs [" + maxRunningJobsPerNode + "]"));