Skip to content

Commit 3ea8971

Browse files
committed
8269817: serviceability/jvmti/DynamicCodeGenerated/DynamicCodeGeneratedTest.java timed out with -Xcomp
Reviewed-by: cjplummer, kevinw, sspitsyn
1 parent 0a3b0fc commit 3ea8971

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

test/hotspot/jtreg/serviceability/jvmti/DynamicCodeGenerated/DynamicCodeGeneratedTest.java

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2022, 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
@@ -31,27 +31,37 @@
3131
*/
3232

3333
import java.lang.ref.Reference;
34+
import java.util.ArrayList;
35+
import java.util.List;
3436

3537
public class DynamicCodeGeneratedTest {
3638
static {
3739
System.loadLibrary("DynamicCodeGenerated");
3840
}
3941
public static native void changeEventNotificationMode();
4042

41-
public static void main(String[] args) {
43+
public static void main(String[] args) throws Exception {
4244
// Try to enable DynamicCodeGenerated event while it is posted
4345
// using JvmtiDynamicCodeEventCollector from VtableStubs::find_stub
44-
Thread t = new Thread(() -> {
46+
Thread threadChangeENM = new Thread(() -> {
4547
changeEventNotificationMode();
4648
});
47-
t.setDaemon(true);
48-
t.start();
49+
threadChangeENM.setDaemon(true);
50+
threadChangeENM.start();
4951

50-
for (int i = 0; i < 2000; i++) {
51-
new Thread(() -> {
52-
String result = "string" + System.currentTimeMillis();
53-
Reference.reachabilityFence(result);
54-
}).start();
52+
for (int i = 0; i < 10; i++) {
53+
List<Thread> threads = new ArrayList();
54+
for (int j = 0; j < 200; j++) {
55+
Thread t = new Thread(() -> {
56+
String result = "string" + System.currentTimeMillis();
57+
Reference.reachabilityFence(result);
58+
});
59+
threads.add(t);
60+
t.start();
61+
}
62+
for (Thread t: threads) {
63+
t.join();
64+
}
5565
}
5666
}
5767
}

0 commit comments

Comments
 (0)