Fix InternalTestCluster StopRandomNode Assertion (#44258) (#44265)

* The assertion added in #44214 is tripped by tests running dedicated
test clusters per test needlessly.This breaks existing tests like the one in #44245.
* Closes #44245
This commit is contained in:
Armin Braun 2019-07-12 13:18:55 +02:00 committed by GitHub
parent ad6dce16f4
commit 6c02cf0241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -71,7 +71,6 @@ public class IndicesShardStoreRequestIT extends ESIntegTestCase {
assertThat(rsp.getStoreStatuses().size(), equalTo(0));
}
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/44245")
public void testBasic() throws Exception {
String index = "test";
internalCluster().ensureAtLeastNumDataNodes(2);

View File

@ -1632,7 +1632,9 @@ public final class InternalTestCluster extends TestCluster {
ensureOpen();
NodeAndClient nodeAndClient = getRandomNodeAndClient(nc -> filter.test(nc.node.settings()));
if (nodeAndClient != null) {
if (nodeAndClient.nodeAndClientId() < sharedNodesSeeds.length && nodeAndClient.isMasterEligible() && autoManageMasterNodes
if (nodePrefix.equals(ESIntegTestCase.SUITE_CLUSTER_NODE_PREFIX) && nodeAndClient.nodeAndClientId() < sharedNodesSeeds.length
&& nodeAndClient.isMasterEligible()
&& autoManageMasterNodes
&& nodes.values().stream()
.filter(NodeAndClient::isMasterEligible)
.filter(n -> n.nodeAndClientId() < sharedNodesSeeds.length)