Skip to content

Commit 8ac9409

Browse files
committed
Use GCUtils for SourceInternalizationTest.testSourceInterning to avoid transient failures (GR-59764)
1 parent 08165c2 commit 8ac9409

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/source/SourceInternalizationTest.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
import java.util.concurrent.TimeUnit;
6565
import java.util.concurrent.atomic.AtomicInteger;
6666

67-
import org.junit.Assert;
6867
import org.junit.Assume;
6968
import org.junit.BeforeClass;
7069
import org.junit.Test;
@@ -231,15 +230,9 @@ public void testSourceInterning() {
231230
List<WeakReference<Object>> sources = new ArrayList<>();
232231
for (int i = 0; i < GCUtils.GC_TEST_ITERATIONS; i++) {
233232
sources.add(new WeakReference<>(createTestSource(testString, i), queue));
234-
System.gc();
235233
}
236234

237-
int refsCleared = 0;
238-
while (queue.poll() != null) {
239-
refsCleared++;
240-
}
241-
// we need to have any refs cleared for this test to have any value
242-
Assert.assertTrue(refsCleared > 0);
235+
GCUtils.assertGc(testString, sources);
243236
}
244237

245238
private static Object createTestSource(String testString, int i) {

0 commit comments

Comments
 (0)