Skip to content

Commit

Permalink
[test] testSimpleWorkflow() and testListBlobs_26() use same snapshot …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
dadoonet committed Apr 29, 2015
1 parent 8bd131e commit 9925604
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,14 @@ public void testListBlobs_26() throws StorageException, URISyntaxException {
assertThat(client.prepareGetSnapshots("test-repo").get().getSnapshots().size(), equalTo(0));

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

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

// Clean the snapshot
client.prepareDeleteSnapshot("test-repo", "test-snap").get();
client.prepareDeleteSnapshot("test-repo", "test-snap-26").get();
client.prepareDeleteRepository("test-repo").get();

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

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

// Get all snapshots - should have one
Expand Down

0 comments on commit 9925604

Please sign in to comment.