@@ -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