From 16c55acd84d389c9eea194ae9bbf89834907563b Mon Sep 17 00:00:00 2001 From: Nate Bauernfeind Date: Sat, 12 Oct 2024 07:16:04 -0600 Subject: [PATCH] fix(test): Eliminate Race Between LivenessScope Closing and GC (#6197) Fixes #3545. --- .../engine/table/impl/QueryTableAjTest.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java index beb0e813ffa..08057bbfa14 100644 --- a/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java +++ b/engine/table/src/test/java/io/deephaven/engine/table/impl/QueryTableAjTest.java @@ -3,6 +3,7 @@ // package io.deephaven.engine.table.impl; +import io.deephaven.engine.liveness.LivenessScope; import io.deephaven.engine.table.impl.AsOfJoinMatchFactory.AsOfJoinResult; import io.deephaven.base.clock.Clock; import io.deephaven.base.testing.BaseArrayTestCase; @@ -661,31 +662,31 @@ public void testAjRandomLeftIncrementalRightStatic() { for (int leftSize = 10; leftSize <= maxLeftSize; leftSize *= leftFactor) { for (int rightSize = 10; rightSize <= maxRightSize; rightSize *= rightFactor) { System.out.println("Seed=" + seed + ", leftSize=" + leftSize + ", rightSize=" + rightSize); - try (final SafeCloseable ignored = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open(new LivenessScope(true), true)) { testAjRandomIncremental(base.leftStep, seed, leftSize, rightSize, true, false, false, false); } - try (final SafeCloseable ignored = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open(new LivenessScope(true), true)) { testAjRandomIncremental(base.leftStep, seed, leftSize, rightSize, true, false, true, false); } - try (final SafeCloseable ignored = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open(new LivenessScope(true), true)) { testAjRandomIncremental(base.leftStep, seed, leftSize, rightSize, true, false, false, true); } - try (final SafeCloseable ignored = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open(new LivenessScope(true), true)) { testAjRandomIncremental(base.leftStep, seed, leftSize, rightSize, true, false, true, true); } - try (final SafeCloseable ignored = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open(new LivenessScope(true), true)) { testAjRandomIncremental(base.leftStepShift, seed, leftSize, rightSize, true, false, false, false); } - try (final SafeCloseable ignored = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open(new LivenessScope(true), true)) { testAjRandomIncremental(base.leftStepShift, seed, leftSize, rightSize, true, false, true, false); } - try (final SafeCloseable ignored = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open(new LivenessScope(true), true)) { testAjRandomIncremental(base.leftStepShift, seed, leftSize, rightSize, true, false, false, true); } - try (final SafeCloseable ignored = LivenessScopeStack.open()) { + try (final SafeCloseable ignored = LivenessScopeStack.open(new LivenessScope(true), true)) { testAjRandomIncremental(base.leftStepShift, seed, leftSize, rightSize, true, false, true, true); } }