[TEST] Mock Directory didn't clean wrapped dirs
I ran the bad apple test for index memory leaks and still saw leaks, it seems like we don't properly clean the dirs from the static mock test dir wrapper
This commit is contained in:
parent
395960feef
commit
683050c6ed
|
@ -54,7 +54,7 @@ public class IndicesLeaksTests extends ElasticsearchIntegrationTest {
|
|||
|
||||
client().admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
|
||||
|
||||
IndicesService indicesService = internalCluster().getInstance(IndicesService.class);
|
||||
IndicesService indicesService = internalCluster().getDataNodeInstance(IndicesService.class);
|
||||
IndexService indexService = indicesService.indexServiceSafe("test");
|
||||
Injector indexInjector = indexService.injector();
|
||||
IndexShard shard = indexService.shardSafe(0);
|
||||
|
@ -90,7 +90,7 @@ public class IndicesLeaksTests extends ElasticsearchIntegrationTest {
|
|||
shard = null;
|
||||
shardInjector = null;
|
||||
|
||||
client().admin().indices().prepareDelete().execute().actionGet();
|
||||
cluster().wipeIndices("test");
|
||||
|
||||
for (int i = 0; i < 100; i++) {
|
||||
System.gc();
|
||||
|
@ -112,7 +112,7 @@ public class IndicesLeaksTests extends ElasticsearchIntegrationTest {
|
|||
}
|
||||
}
|
||||
|
||||
//Thread.sleep(1000000);
|
||||
//System.out.println("sleeping");Thread.sleep(1000000);
|
||||
|
||||
for (WeakReference indexReference : indexReferences) {
|
||||
assertThat("dangling index reference: " + indexReference.get(), indexReference.get(), nullValue());
|
||||
|
|
|
@ -141,6 +141,7 @@ public class MockDirectoryHelper {
|
|||
synchronized (lock) {
|
||||
lock.notifyAll();
|
||||
}
|
||||
wrappers.remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue