Skip to content

Commit ae78944

Browse files
authored
Fix flaky RepositoriesServiceIT.testCreatSnapAndUpdateReposityCauseInfiniteLoop (#18209)
Signed-off-by: kkewwei <kewei.11@bytedance.com> Signed-off-by: kkewwei <kkewwei@163.com>
1 parent bf8cd25 commit ae78944

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/internalClusterTest/java/org/opensearch/repositories/RepositoriesServiceIT.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
import java.util.Collection;
4646
import java.util.Collections;
47+
import java.util.concurrent.atomic.AtomicInteger;
4748

4849
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS;
4950
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS;
@@ -149,9 +150,10 @@ public void testCreatSnapAndUpdateReposityCauseInfiniteLoop() throws Interrupted
149150
repoSettings
150151
);
151152

152-
String snapshotName = "test-snapshot";
153+
final AtomicInteger snapshotCount = new AtomicInteger();
153154
Runnable createSnapshot = () -> {
154-
logger.info("--> begining snapshot");
155+
String snapshotName = "snapshot-" + snapshotCount.incrementAndGet();
156+
logger.info("--> beginning snapshot for " + snapshotName);
155157
client().admin()
156158
.cluster()
157159
.prepareCreateSnapshot(repositoryName, snapshotName)

0 commit comments

Comments
 (0)