diff options
author | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-17 13:52:43 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-17 13:54:04 +0200 |
commit | 441197acb9f207afbbc67bbcb93aa95def71d000 (patch) | |
tree | 45805499270d23e20707c9fc6023770128d925f2 /jdisc_core/src/test | |
parent | d977da45ba86d878f25eba4cd692af7b93cf5eb5 (diff) |
Ensure that phantom references are enqueued to reference queue
Diffstat (limited to 'jdisc_core/src/test')
-rw-r--r-- | jdisc_core/src/test/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdogTest.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/jdisc_core/src/test/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdogTest.java b/jdisc_core/src/test/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdogTest.java index 05207728c88..a618b82c5ec 100644 --- a/jdisc_core/src/test/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdogTest.java +++ b/jdisc_core/src/test/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdogTest.java @@ -6,7 +6,6 @@ import com.yahoo.jdisc.ResourceReference; import com.yahoo.jdisc.statistics.ActiveContainerMetrics; import com.yahoo.jdisc.test.TestDriver; import com.yahoo.test.ManualClock; -import org.junit.Ignore; import org.junit.Test; import java.lang.ref.WeakReference; @@ -69,7 +68,6 @@ public class ActiveContainerDeactivationWatchdogTest { } @Test - @Ignore("JVM does not give any guarantee when phantom references will be enqueued to reference queues") public void deactivated_container_destructed_if_its_reference_counter_is_nonzero() { ExecutorMock executor = new ExecutorMock(); ActiveContainerDeactivationWatchdog watchdog = @@ -87,6 +85,7 @@ public class ActiveContainerDeactivationWatchdogTest { WeakReference<ActiveContainer> containerWeakReference = new WeakReference<>(container); container = null; // make container instance collectable by GC System.gc(); + System.runFinalization(); // this is required to trigger enqueuing of phantom references on some Linux systems assertNull("Container is not GCed - probably because the watchdog has a concrete reference to it", containerWeakReference.get()); |