Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import java.util.UUID;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BiFunction;

import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_WAIT_FOR_ACTIVE_SHARDS;
Expand Down Expand Up @@ -257,6 +258,7 @@ public void testCreateAndDeleteIndexConcurrently() throws InterruptedException {
synchronized (indexVersionLock) { // not necessarily needed here but for completeness we lock here too
indexVersion.incrementAndGet();
}
final AtomicReference<Exception> deleteFailure = new AtomicReference<>();
client().admin().indices().prepareDelete("test").execute(new ActionListener<AcknowledgedResponse>() { // this happens async!!!
@Override
public void onResponse(AcknowledgedResponse deleteIndexResponse) {
Expand Down Expand Up @@ -284,7 +286,8 @@ public void run() {

@Override
public void onFailure(Exception e) {
throw new RuntimeException(e);
deleteFailure.set(e);
latch.countDown();
}
});
numDocs = randomIntBetween(100, 200);
Expand All @@ -304,6 +307,7 @@ public void onFailure(Exception e) {
}
}
latch.await();
assertNull(deleteFailure.get());
refresh();

// we only really assert that we never reuse segments of old indices or anything like this here and that nothing fails with
Expand Down
Loading