Skip to content

Commit

Permalink
Wipe repositories more often (#42511)
Browse files Browse the repository at this point in the history
Fixes an issue where repositories are unintentionally shared among tests (given that the repo contents is captured in a static variable on the test class, to allow "sharing" among nodes) and two tests randomly chose the same snapshot name, leading to a conflict.

Closes #42519
  • Loading branch information
ywelsch authored May 24, 2019
1 parent d992b1d commit 43848fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.repositories.Repository;
import org.elasticsearch.repositories.blobstore.ESBlobStoreRepositoryIntegTestCase;
import org.junit.AfterClass;
import org.junit.After;

import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -67,8 +67,8 @@ protected void afterCreationCheck(Repository repository) {
assertThat(repository, instanceOf(GoogleCloudStorageRepository.class));
}

@AfterClass
public static void wipeRepository() {
@After
public void wipeRepository() {
blobs.clear();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.elasticsearch.rest.action.admin.cluster.RestGetRepositoriesAction;
import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.threadpool.ThreadPool;
import org.junit.AfterClass;
import org.junit.After;
import org.junit.BeforeClass;

import java.util.Collection;
Expand Down Expand Up @@ -78,8 +78,8 @@ public static void setUpRepositorySettings() {
}
}

@AfterClass
public static void wipeRepository() {
@After
public void wipeRepository() {
blobs.clear();
}

Expand Down

0 comments on commit 43848fc

Please sign in to comment.