[TEST] Mmm, still wrap wrappers still its needed post closing dir

previous push was partial by mistake, we still need the wrapped dirs around after being closed for the test infra, for now, explicitly clear it in the leak test (which is still bad apple)
This commit is contained in:
Shay Banon 2015-01-15 17:57:47 -07:00
parent 683050c6ed
commit 716cc5fb05
2 changed files with 2 additions and 1 deletions

View File

@ -28,6 +28,7 @@ import org.elasticsearch.index.shard.IndexShard;
import org.elasticsearch.indices.IndicesService; import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.test.ElasticsearchIntegrationTest; import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.store.MockDirectoryHelper;
import org.junit.Test; import org.junit.Test;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
@ -91,6 +92,7 @@ public class IndicesLeaksTests extends ElasticsearchIntegrationTest {
shardInjector = null; shardInjector = null;
cluster().wipeIndices("test"); cluster().wipeIndices("test");
MockDirectoryHelper.wrappers.clear(); // we need to clear this to allow the objects to recycle
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
System.gc(); System.gc();

View File

@ -141,7 +141,6 @@ public class MockDirectoryHelper {
synchronized (lock) { synchronized (lock) {
lock.notifyAll(); lock.notifyAll();
} }
wrappers.remove(this);
} }
} }