Remove timed latch await in listeners test

This commit removes a timed latch await in a transport client listeners
test. The problem with a timed wait here is that on an overloaded
machine, the test can fail because the waiting thread was not unlatched
quickly enough. This makes the test unnecessarily flaky. Instead, we
should wait indefinitely and simply let the test fail by the test
timeout if the latch is not counted down for some reason.

Closes #25760
This commit is contained in:
Jason Tedor 2017-07-19 16:51:27 +09:00
parent 3d3d99557d
commit 82f52b17e1
1 changed files with 1 additions and 1 deletions

View File

@ -270,7 +270,7 @@ public class TransportClientNodesServiceTests extends ESTestCase {
});
}, actionListener);
assertThat(latch.await(1, TimeUnit.SECONDS), equalTo(true));
latch.await();
//there can be only either one failure that causes the request to fail straightaway or success
assertThat(preSendFailures.get() + iteration.transport.failures() + iteration.transport.successes(), lessThanOrEqualTo(1));