Skip to content

Commit f56b0f1

Browse files
Fix TODO in SnapshotIT (#55465)
This TODO became fixable with #54765
1 parent 8fd81df commit f56b0f1

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
@@ -163,23 +163,12 @@ public void testCreateSnapshot() throws Exception {
163163
CreateSnapshotResponse response = createTestSnapshot(request);
164164
assertEquals(waitForCompletion ? RestStatus.OK : RestStatus.ACCEPTED, response.status());
165165
if (waitForCompletion == false) {
166-
// busy assert on the delete because a known race condition could cause the delete request to not see
167-
// the snapshot if delete and snapshot finalization happen at the same time
168-
// See https://github.com/elastic/elasticsearch/issues/53509#issuecomment-603899620 for details
169-
// TODO: Remove busy assert in 7.x+ once this race is fixed
170-
assertBusy(() -> {
171-
// If we don't wait for the snapshot to complete we have to cancel it to not leak the snapshot task
172-
AcknowledgedResponse deleteResponse;
173-
try {
174-
deleteResponse = execute(
175-
new DeleteSnapshotRequest(repository, snapshot),
176-
highLevelClient().snapshot()::delete, highLevelClient().snapshot()::deleteAsync
177-
);
178-
} catch (Exception e) {
179-
throw new AssertionError(e);
180-
}
181-
assertTrue(deleteResponse.isAcknowledged());
182-
});
166+
// If we don't wait for the snapshot to complete we have to cancel it to not leak the snapshot task
167+
AcknowledgedResponse deleteResponse = execute(
168+
new DeleteSnapshotRequest(repository, snapshot),
169+
highLevelClient().snapshot()::delete, highLevelClient().snapshot()::deleteAsync
170+
);
171+
assertTrue(deleteResponse.isAcknowledged());
183172
}
184173
}
185174

0 commit comments

Comments
 (0)