[TEST] only mark the event as processed when its out of its execution

This commit is contained in:
Shay Banon 2014-07-05 19:08:31 +02:00
parent 2a69ae2f0d
commit 045ce097c9
1 changed files with 6 additions and 2 deletions

View File

@ -435,10 +435,9 @@ public class ClusterServiceTests extends ElasticsearchIntegrationTest {
invoked1.await(); invoked1.await();
final CountDownLatch invoked2 = new CountDownLatch(9); final CountDownLatch invoked2 = new CountDownLatch(9);
for (int i = 2; i <= 10; i++) { for (int i = 2; i <= 10; i++) {
clusterService.submitStateUpdateTask(Integer.toString(i), new ClusterStateUpdateTask() { clusterService.submitStateUpdateTask(Integer.toString(i), new ProcessedClusterStateUpdateTask() {
@Override @Override
public ClusterState execute(ClusterState currentState) { public ClusterState execute(ClusterState currentState) {
invoked2.countDown();
return currentState; return currentState;
} }
@ -446,6 +445,11 @@ public class ClusterServiceTests extends ElasticsearchIntegrationTest {
public void onFailure(String source, Throwable t) { public void onFailure(String source, Throwable t) {
fail(); fail();
} }
@Override
public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
invoked2.countDown();
}
}); });
} }