Skip to content

Commit

Permalink
[TEST] Removed waiting for time out for bulk request in existing inde…
Browse files Browse the repository at this point in the history
…x, since in improve_zen the metadata isn't cleared if there is a no master block
  • Loading branch information
martijnvg authored and bleskes committed Aug 22, 2014
1 parent 6362f32 commit afe1f91
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/test/java/org/elasticsearch/cluster/NoMasterNodeTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,9 @@ public void run() {
bulkRequestBuilder.get();
fail("Expected ClusterBlockException");
} catch (ClusterBlockException | MasterNotDiscoveredException e) {
// today, we clear the metadata on when there is no master, so it will go through the auto create logic and
// add it... (if set to true), if we didn't remove the metedata when there is no master, then, the non
// retry in bulk should be taken into account
if (!autoCreateIndex) {
assertThat(System.currentTimeMillis() - now, lessThan(50l));
} else {
assertThat(System.currentTimeMillis() - now, greaterThan(timeout.millis() - 50));
assertThat(e.status(), equalTo(RestStatus.SERVICE_UNAVAILABLE));
}
// The metadata isn't cleared and because bulk api doesn't retry global blocks we fail fast
assertThat(System.currentTimeMillis() - now, lessThan(50l));
assertThat(e.status(), equalTo(RestStatus.SERVICE_UNAVAILABLE));
}

now = System.currentTimeMillis();
Expand All @@ -228,9 +222,8 @@ public void run() {
bulkRequestBuilder.get();
fail("Expected ClusterBlockException");
} catch (ClusterBlockException | MasterNotDiscoveredException e) {
// today, we clear the metadata on when there is no master, so it will go through the auto create logic and
// add it... (if set to true), if we didn't remove the metedata when there is no master, then, the non
// retry in bulk should be taken into account
// If the index exists the bulk doesn't retry with a global block, if an index doesn't exist bulk api delegates
// to the create index api which does retry / wait on a global block.
if (!autoCreateIndex) {
assertThat(System.currentTimeMillis() - now, lessThan(50l));
} else {
Expand Down

0 comments on commit afe1f91

Please sign in to comment.