Skip to content

Commit 0e2f436

Browse files
committed
[test] testSimpleWorkflow() and testListBlobs_26() use same snapshot name
`testSimpleWorkflow()` and `testListBlobs_26()` use same `test-snap` snapshot name. So we might get this issue: ``` 2015-04-29 12:02:47,279 WARN snapshots - [node_s0] failed to create snapshot [test-repo:test-snap] InvalidSnapshotNameException[[test-repo:test-snap] Invalid snapshot name [test-snap], snapshot with such name already exists] at org.elasticsearch.repositories.blobstore.BlobStoreRepository.initializeSnapshot(BlobStoreRepository.java:228) at org.elasticsearch.repositories.azure.AzureRepository.initializeSnapshot(AzureRepository.java:148) at org.elasticsearch.snapshots.SnapshotsService.beginSnapshot(SnapshotsService.java:303) at org.elasticsearch.snapshots.SnapshotsService.access$500(SnapshotsService.java:88) at org.elasticsearch.snapshots.SnapshotsService$1$1.run(SnapshotsService.java:229) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) ``` Closes #85. (cherry picked from commit 9925604) (cherry picked from commit 409fd1e)
1 parent fcab199 commit 0e2f436

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreITest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,14 @@ public void testListBlobs_26() throws StorageException, URISyntaxException {
272272
assertThat(client.prepareGetSnapshots("test-repo").get().getSnapshots().size(), equalTo(0));
273273

274274
logger.info("--> snapshot");
275-
CreateSnapshotResponse createSnapshotResponse = client.prepareCreateSnapshot("test-repo", "test-snap").setWaitForCompletion(true).setIndices("test-idx-*").get();
275+
CreateSnapshotResponse createSnapshotResponse = client.prepareCreateSnapshot("test-repo", "test-snap-26").setWaitForCompletion(true).setIndices("test-idx-*").get();
276276
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), greaterThan(0));
277277

278278
// Get all snapshots - should have one
279279
assertThat(client.prepareGetSnapshots("test-repo").get().getSnapshots().size(), equalTo(1));
280280

281281
// Clean the snapshot
282-
client.prepareDeleteSnapshot("test-repo", "test-snap").get();
282+
client.prepareDeleteSnapshot("test-repo", "test-snap-26").get();
283283
client.prepareDeleteRepository("test-repo").get();
284284

285285
logger.info("--> creating azure repository path [{}]", getRepositoryPath());
@@ -294,7 +294,7 @@ public void testListBlobs_26() throws StorageException, URISyntaxException {
294294
assertThat(client.prepareGetSnapshots("test-repo").get().getSnapshots().size(), equalTo(0));
295295

296296
logger.info("--> snapshot");
297-
createSnapshotResponse = client.prepareCreateSnapshot("test-repo", "test-snap").setWaitForCompletion(true).setIndices("test-idx-*").get();
297+
createSnapshotResponse = client.prepareCreateSnapshot("test-repo", "test-snap-26").setWaitForCompletion(true).setIndices("test-idx-*").get();
298298
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), greaterThan(0));
299299

300300
// Get all snapshots - should have one

0 commit comments

Comments
 (0)