Skip to content

Commit e0195fa

Browse files
Fix TODO in SnapshotIT (#55465) (#55469)
This TODO became fixable with #54765
1 parent 7817948 commit e0195fa

File tree

1 file changed

+6
-17
lines changed
  • client/rest-high-level/src/test/java/org/elasticsearch/client

1 file changed

+6
-17
lines changed

client/rest-high-level/src/test/java/org/elasticsearch/client/SnapshotIT.java

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -165,23 +165,12 @@ public void testCreateSnapshot() throws Exception {
165165
CreateSnapshotResponse response = createTestSnapshot(request);
166166
assertEquals(waitForCompletion ? RestStatus.OK : RestStatus.ACCEPTED, response.status());
167167
if (waitForCompletion == false) {
168-
// busy assert on the delete because a known race condition could cause the delete request to not see
169-
// the snapshot if delete and snapshot finalization happen at the same time
170-
// See https://github.com/elastic/elasticsearch/issues/53509#issuecomment-603899620 for details
171-
// TODO: Remove busy assert in 7.x+ once this race is fixed
172-
assertBusy(() -> {
173-
// If we don't wait for the snapshot to complete we have to cancel it to not leak the snapshot task
174-
AcknowledgedResponse deleteResponse;
175-
try {
176-
deleteResponse = execute(
177-
new DeleteSnapshotRequest(repository, snapshot),
178-
highLevelClient().snapshot()::delete, highLevelClient().snapshot()::deleteAsync
179-
);
180-
} catch (Exception e) {
181-
throw new AssertionError(e);
182-
}
183-
assertTrue(deleteResponse.isAcknowledged());
184-
});
168+
// If we don't wait for the snapshot to complete we have to cancel it to not leak the snapshot task
169+
AcknowledgedResponse deleteResponse = execute(
170+
new DeleteSnapshotRequest(repository, snapshot),
171+
highLevelClient().snapshot()::delete, highLevelClient().snapshot()::deleteAsync
172+
);
173+
assertTrue(deleteResponse.isAcknowledged());
185174
}
186175
}
187176

0 commit comments

Comments
 (0)