Test: ClusterServiceTetsts.testLocalNodeMasterListenerCallbacks should verify cluster state is applied
The test verifies the correct behavior of a listener but we only call the listener after publishing a new cluster state. Only checking on the publishing of the state introduces a racing condition.
This commit is contained in:
parent
1c66317443
commit
4396e6b48e
|
@ -654,7 +654,7 @@ public class ClusterServiceTests extends ElasticsearchIntegrationTest {
|
|||
// there should not be any master as the minimum number of required eligible masters is not met
|
||||
awaitBusy(new Predicate<Object>() {
|
||||
public boolean apply(Object obj) {
|
||||
return clusterService1.state().nodes().masterNode() == null;
|
||||
return clusterService1.state().nodes().masterNode() == null && clusterService1.state().status() == ClusterState.ClusterStateStatus.APPLIED;
|
||||
}
|
||||
});
|
||||
assertThat(testService1.master(), is(false));
|
||||
|
|
Loading…
Reference in New Issue