-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Closed
Labels
>testIssues or PRs that are addressing/adding testsIssues or PRs that are addressing/adding tests
Description
This test sporadically fails when it runs on a CI machine that slows down a bit. The test relies on timing, which is a big NONO:
long now = System.currentTimeMillis();
try {
builder.get();
fail("Expected ClusterBlockException");
} catch (ClusterBlockException e) {
if (indexShouldBeAutoCreated) {
// timeout is 200
assertThat(System.currentTimeMillis() - now, greaterThan(timeout.millis() - 50));
assertThat(e.status(), equalTo(RestStatus.SERVICE_UNAVAILABLE));
} else {
// timeout is 5000
assertThat(System.currentTimeMillis() - now, lessThan(timeout.millis() + 300));
}
}
Failure:
ERROR 33.8s J0 | NoMasterNodeIT.testNoMasterActions <<< FAILURES!
> Throwable #1: java.lang.AssertionError:
> Expected: a value less than <250L>
> but: <269L> was greater than <250L>
> at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
> at org.elasticsearch.cluster.NoMasterNodeIT.checkWriteAction(NoMasterNodeIT.java:182)
> at org.elasticsearch.cluster.NoMasterNodeIT.testNoMasterActions(NoMasterNodeIT.java:127)
> at java.lang.Thread.run(Thread.java:745)Throwable #2: MasterNotDiscoveredException[null]
> at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$4.onTimeout(TransportMasterNodeAction.java:209)
...
Metadata
Metadata
Assignees
Labels
>testIssues or PRs that are addressing/adding testsIssues or PRs that are addressing/adding tests