From 18b42ce79818e5d5f46e3f976cd5166140878094 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 29 Dec 2015 20:45:54 -0500 Subject: [PATCH] Simplify cluster state task execution ordering test --- .../java/org/elasticsearch/cluster/ClusterServiceIT.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/cluster/ClusterServiceIT.java b/core/src/test/java/org/elasticsearch/cluster/ClusterServiceIT.java index 9e0b65b6f79..2a7c22f9141 100644 --- a/core/src/test/java/org/elasticsearch/cluster/ClusterServiceIT.java +++ b/core/src/test/java/org/elasticsearch/cluster/ClusterServiceIT.java @@ -806,13 +806,13 @@ public class ClusterServiceIT extends ESIntegTestCase { ClusterService clusterService = internalCluster().getInstance(ClusterService.class); class TaskExecutor implements ClusterStateTaskExecutor { - int tracking = -1; + int tracking = 0; @Override public BatchResult execute(ClusterState currentState, List tasks) throws Exception { for (Integer task : tasks) { try { - assertEquals("task was executed out of order", tracking + 1, (int)task); + assertEquals("task was executed out of order", tracking, (int)task); tracking++; } catch (AssertionError e) { return BatchResult.builder().failures(tasks, e).build(currentState); @@ -886,7 +886,7 @@ public class ClusterServiceIT extends ESIntegTestCase { assertFalse(failure.get()); for (int i = 0; i < numberOfThreads; i++) { - assertEquals(tasksSubmittedPerThread - 1, executors[i].tracking); + assertEquals(tasksSubmittedPerThread, executors[i].tracking); } }