Test: create private store for these test cases

This commit is contained in:
Michael McCandless 2014-12-11 05:25:44 -05:00 committed by mikemccand
parent a2ffe494ae
commit 084d25cdbd
1 changed files with 4 additions and 5 deletions

View File

@ -392,9 +392,7 @@ public class InternalEngineTests extends ElasticsearchLuceneTestCase {
@Test @Test
public void testSegmentsWithMergeFlag() throws Exception { public void testSegmentsWithMergeFlag() throws Exception {
// Close engine from setUp (we create our own): final Store store = createStore();
engine.close();
ConcurrentMergeSchedulerProvider mergeSchedulerProvider = new ConcurrentMergeSchedulerProvider(shardId, EMPTY_SETTINGS, threadPool, new IndexSettingsService(shardId.index(), EMPTY_SETTINGS)); ConcurrentMergeSchedulerProvider mergeSchedulerProvider = new ConcurrentMergeSchedulerProvider(shardId, EMPTY_SETTINGS, threadPool, new IndexSettingsService(shardId.index(), EMPTY_SETTINGS));
final AtomicReference<CountDownLatch> waitTillMerge = new AtomicReference<>(); final AtomicReference<CountDownLatch> waitTillMerge = new AtomicReference<>();
final AtomicReference<CountDownLatch> waitForMerge = new AtomicReference<>(); final AtomicReference<CountDownLatch> waitForMerge = new AtomicReference<>();
@ -488,6 +486,7 @@ public class InternalEngineTests extends ElasticsearchLuceneTestCase {
} }
engine.close(); engine.close();
store.close();
} }
@Test @Test
@ -1366,8 +1365,7 @@ public class InternalEngineTests extends ElasticsearchLuceneTestCase {
@Test @Test
public void testEnableGcDeletes() throws Exception { public void testEnableGcDeletes() throws Exception {
// Close engine from setUp (we create our own): Store store = createStore();
engine.close();
// Make sure enableGCDeletes == false works: // Make sure enableGCDeletes == false works:
Settings settings = ImmutableSettings.builder() Settings settings = ImmutableSettings.builder()
@ -1436,6 +1434,7 @@ public class InternalEngineTests extends ElasticsearchLuceneTestCase {
getResult = engine.get(new Engine.Get(true, newUid("2"))); getResult = engine.get(new Engine.Get(true, newUid("2")));
assertThat(getResult.exists(), equalTo(false)); assertThat(getResult.exists(), equalTo(false));
engine.close(); engine.close();
store.close();
} }
protected Term newUid(String id) { protected Term newUid(String id) {