Skip to content

Commit

Permalink
Test: wait for the cluster to recover in ClusterServiceTests before w…
Browse files Browse the repository at this point in the history
…aiting for update state task results

On CI machines node recovery sometimes takes up to 2 seconds. When it happens an update cluster state task gets stuck behind the recovery and tests fail with 1 second timeout. This commit makes sure that we wait for recovery to complete before starting the clock.
  • Loading branch information
imotov committed Feb 12, 2015
1 parent f735baf commit 9b75d3e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public void onFailure(String source, Throwable t) {
}
});

ensureGreen();
assertThat(latch.await(1, TimeUnit.SECONDS), equalTo(true));

assertThat(allNodesAcked.get(), equalTo(true));
Expand Down Expand Up @@ -247,6 +248,7 @@ public void onFailure(String source, Throwable t) {
}
});

ensureGreen();
assertThat(latch.await(1, TimeUnit.SECONDS), equalTo(true));

assertThat(allNodesAcked.get(), equalTo(true));
Expand Down Expand Up @@ -373,6 +375,7 @@ public void onFailure(String source, Throwable t) {
}
});

ensureGreen();
assertThat(latch.await(1, TimeUnit.SECONDS), equalTo(true));

assertThat(allNodesAcked.get(), equalTo(true));
Expand Down Expand Up @@ -447,6 +450,7 @@ public void onFailure(String source, Throwable t) {
}
});

ensureGreen();
assertThat(latch.await(1, TimeUnit.SECONDS), equalTo(true));

assertThat(allNodesAcked.get(), equalTo(false));
Expand Down

0 comments on commit 9b75d3e

Please sign in to comment.