Wipe repositories more often (#42511)

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
This commit is contained in:
Yannick Welsch 2019-05-24 17:18:53 +02:00
parent 4da0fadedc
commit e5a4a2272b
2 changed files with 6 additions and 6 deletions

View File

@ -27,7 +27,7 @@ import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.repositories.Repository; import org.elasticsearch.repositories.Repository;
import org.elasticsearch.repositories.blobstore.ESBlobStoreRepositoryIntegTestCase; import org.elasticsearch.repositories.blobstore.ESBlobStoreRepositoryIntegTestCase;
import org.junit.AfterClass; import org.junit.After;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
@ -67,8 +67,8 @@ public class GoogleCloudStorageBlobStoreRepositoryTests extends ESBlobStoreRepos
assertThat(repository, instanceOf(GoogleCloudStorageRepository.class)); assertThat(repository, instanceOf(GoogleCloudStorageRepository.class));
} }
@AfterClass @After
public static void wipeRepository() { public void wipeRepository() {
blobs.clear(); blobs.clear();
} }

View File

@ -38,7 +38,7 @@ import org.elasticsearch.rest.RestResponse;
import org.elasticsearch.rest.action.admin.cluster.RestGetRepositoriesAction; import org.elasticsearch.rest.action.admin.cluster.RestGetRepositoriesAction;
import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
import org.junit.AfterClass; import org.junit.After;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import java.util.Collection; import java.util.Collection;
@ -78,8 +78,8 @@ public class S3BlobStoreRepositoryTests extends ESBlobStoreRepositoryIntegTestCa
} }
} }
@AfterClass @After
public static void wipeRepository() { public void wipeRepository() {
blobs.clear(); blobs.clear();
} }