Skip to content

Commit 66a5675

Browse files
authored
DanglingIndicesIT should ensure node removed first (#50896)
These tests occasionally failed because the deletion was submitted before the restarting node was removed from the cluster, causing the deletion not to be fully acked. This commit fixes this by checking the restarting node has been removed from the cluster.
1 parent 9b805b0 commit 66a5675

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/src/test/java/org/elasticsearch/indices/recovery/DanglingIndicesIT.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public void testDanglingIndicesAreRecoveredWhenSettingIsEnabled() throws Excepti
7777

7878
@Override
7979
public Settings onNodeStopped(String nodeName) throws Exception {
80+
ensureClusterSizeConsistency();
8081
assertAcked(client().admin().indices().prepareDelete(INDEX_NAME));
8182
return super.onNodeStopped(nodeName);
8283
}
@@ -107,6 +108,7 @@ public void testDanglingIndicesAreNotRecoveredWhenSettingIsDisabled() throws Exc
107108

108109
@Override
109110
public Settings onNodeStopped(String nodeName) throws Exception {
111+
ensureClusterSizeConsistency();
110112
assertAcked(client().admin().indices().prepareDelete(INDEX_NAME));
111113
return super.onNodeStopped(nodeName);
112114
}
@@ -136,6 +138,7 @@ public void testDanglingIndicesAreNotRecoveredWhenNotWritten() throws Exception
136138

137139
@Override
138140
public Settings onNodeStopped(String nodeName) throws Exception {
141+
ensureClusterSizeConsistency();
139142
assertAcked(client().admin().indices().prepareDelete(INDEX_NAME));
140143
return super.onNodeStopped(nodeName);
141144
}

0 commit comments

Comments
 (0)