Skip to content

Commit 6c02cf0

Browse files
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
1 parent ad6dce1 commit 6c02cf0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

server/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreRequestIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public void testEmpty() {
7171
assertThat(rsp.getStoreStatuses().size(), equalTo(0));
7272
}
7373

74-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/44245")
7574
public void testBasic() throws Exception {
7675
String index = "test";
7776
internalCluster().ensureAtLeastNumDataNodes(2);

test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,9 @@ public synchronized void stopRandomNode(final Predicate<Settings> filter) throws
16321632
ensureOpen();
16331633
NodeAndClient nodeAndClient = getRandomNodeAndClient(nc -> filter.test(nc.node.settings()));
16341634
if (nodeAndClient != null) {
1635-
if (nodeAndClient.nodeAndClientId() < sharedNodesSeeds.length && nodeAndClient.isMasterEligible() && autoManageMasterNodes
1635+
if (nodePrefix.equals(ESIntegTestCase.SUITE_CLUSTER_NODE_PREFIX) && nodeAndClient.nodeAndClientId() < sharedNodesSeeds.length
1636+
&& nodeAndClient.isMasterEligible()
1637+
&& autoManageMasterNodes
16361638
&& nodes.values().stream()
16371639
.filter(NodeAndClient::isMasterEligible)
16381640
.filter(n -> n.nodeAndClientId() < sharedNodesSeeds.length)

0 commit comments

Comments
 (0)