From 535a245354c1dd57b46adee0d3c6ffdb8d8c2e63 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Sat, 18 Jun 2016 18:44:54 +0200 Subject: [PATCH] testSingleBatchSubmission - random numbers don't have to be unique --- .../elasticsearch/cluster/service/ClusterServiceTests.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/cluster/service/ClusterServiceTests.java b/core/src/test/java/org/elasticsearch/cluster/service/ClusterServiceTests.java index 306eecf81b5..66f96f8cd3a 100644 --- a/core/src/test/java/org/elasticsearch/cluster/service/ClusterServiceTests.java +++ b/core/src/test/java/org/elasticsearch/cluster/service/ClusterServiceTests.java @@ -23,7 +23,6 @@ import org.apache.log4j.Logger; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.Version; import org.elasticsearch.cluster.ClusterChangedEvent; -import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterStateTaskConfig; import org.elasticsearch.cluster.ClusterStateTaskExecutor; @@ -33,7 +32,6 @@ import org.elasticsearch.cluster.NodeConnectionsService; import org.elasticsearch.cluster.block.ClusterBlocks; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.routing.OperationRouting; import org.elasticsearch.common.Priority; import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.common.lease.Releasable; @@ -382,7 +380,7 @@ public class ClusterServiceTests extends ESTestCase { final int numOfTasks = randomInt(10); final CountDownLatch latch = new CountDownLatch(numOfTasks); for (int i = 0; i < numOfTasks; i++) { - tasks.put(randomInt(1024), new ClusterStateTaskListener() { + while (null != tasks.put(randomInt(1024), new ClusterStateTaskListener() { @Override public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { latch.countDown(); @@ -392,7 +390,7 @@ public class ClusterServiceTests extends ESTestCase { public void onFailure(String source, Throwable t) { fail(ExceptionsHelper.detailedMessage(t)); } - }); + })) ; } clusterService.submitStateUpdateTasks("test", tasks, ClusterStateTaskConfig.build(Priority.LANGUID),