From 716cc5fb059e91647b66acd0b87b963c89641901 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Thu, 15 Jan 2015 17:57:47 -0700 Subject: [PATCH] [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) --- .../java/org/elasticsearch/indices/leaks/IndicesLeaksTests.java | 2 ++ .../java/org/elasticsearch/test/store/MockDirectoryHelper.java | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/indices/leaks/IndicesLeaksTests.java b/src/test/java/org/elasticsearch/indices/leaks/IndicesLeaksTests.java index d7c53278276..28bcd9f63d9 100644 --- a/src/test/java/org/elasticsearch/indices/leaks/IndicesLeaksTests.java +++ b/src/test/java/org/elasticsearch/indices/leaks/IndicesLeaksTests.java @@ -28,6 +28,7 @@ import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.test.ElasticsearchIntegrationTest; import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; +import org.elasticsearch.test.store.MockDirectoryHelper; import org.junit.Test; import java.lang.ref.WeakReference; @@ -91,6 +92,7 @@ public class IndicesLeaksTests extends ElasticsearchIntegrationTest { shardInjector = null; cluster().wipeIndices("test"); + MockDirectoryHelper.wrappers.clear(); // we need to clear this to allow the objects to recycle for (int i = 0; i < 100; i++) { System.gc(); diff --git a/src/test/java/org/elasticsearch/test/store/MockDirectoryHelper.java b/src/test/java/org/elasticsearch/test/store/MockDirectoryHelper.java index 8f2f86f45ca..a2b32322507 100644 --- a/src/test/java/org/elasticsearch/test/store/MockDirectoryHelper.java +++ b/src/test/java/org/elasticsearch/test/store/MockDirectoryHelper.java @@ -141,7 +141,6 @@ public class MockDirectoryHelper { synchronized (lock) { lock.notifyAll(); } - wrappers.remove(this); } }