Skip to content

Commit f3d0c45

Browse files
author
Doug Simon
committed
8327829: [JVMCI] runtime/ClassUnload/ConstantPoolDependsTest.java fails on libgraal
Reviewed-by: dholmes, never
1 parent d5b95a0 commit f3d0c45

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

test/hotspot/jtreg/runtime/ClassUnload/ConstantPoolDependsTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
3939
import jdk.test.lib.classloader.ClassUnloadCommon;
4040

4141
import java.lang.ref.Reference;
42+
import java.util.List;
43+
import java.util.Set;
4244
public class ConstantPoolDependsTest {
4345
public static WhiteBox wb = WhiteBox.getWhiteBox();
4446
public static final String MY_TEST = "ConstantPoolDependsTest$c1c";
@@ -78,10 +80,7 @@ static void test() throws Throwable {
7880

7981
public static void main(String args[]) throws Throwable {
8082
test();
81-
ClassUnloadCommon.triggerUnloading(); // should unload
82-
System.gc();
83-
System.out.println("Should unload p2.c2 just now");
84-
ClassUnloadCommon.failIf(wb.isClassAlive(MY_TEST), "should be unloaded");
85-
ClassUnloadCommon.failIf(wb.isClassAlive("p2.c2"), "should be unloaded");
83+
Set<String> aliveClasses = ClassUnloadCommon.triggerUnloading(List.of(MY_TEST, "p2.c2"));
84+
ClassUnloadCommon.failIf(!aliveClasses.isEmpty(), "should be unloaded: " + aliveClasses);
8685
}
8786
}

0 commit comments

Comments
 (0)