From 045ce097c9f4b74a59db86d03716060f597bfbac Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Sat, 5 Jul 2014 19:08:31 +0200 Subject: [PATCH] [TEST] only mark the event as processed when its out of its execution --- .../org/elasticsearch/cluster/ClusterServiceTests.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/elasticsearch/cluster/ClusterServiceTests.java b/src/test/java/org/elasticsearch/cluster/ClusterServiceTests.java index 3e89db935b4..51fb027f8f9 100644 --- a/src/test/java/org/elasticsearch/cluster/ClusterServiceTests.java +++ b/src/test/java/org/elasticsearch/cluster/ClusterServiceTests.java @@ -435,10 +435,9 @@ public class ClusterServiceTests extends ElasticsearchIntegrationTest { invoked1.await(); final CountDownLatch invoked2 = new CountDownLatch(9); for (int i = 2; i <= 10; i++) { - clusterService.submitStateUpdateTask(Integer.toString(i), new ClusterStateUpdateTask() { + clusterService.submitStateUpdateTask(Integer.toString(i), new ProcessedClusterStateUpdateTask() { @Override public ClusterState execute(ClusterState currentState) { - invoked2.countDown(); return currentState; } @@ -446,6 +445,11 @@ public class ClusterServiceTests extends ElasticsearchIntegrationTest { public void onFailure(String source, Throwable t) { fail(); } + + @Override + public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { + invoked2.countDown(); + } }); }