From ed36b9bb6f3d429db6accfb3b096e50e7f2217ff Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Thu, 30 Oct 2025 15:34:46 +0000 Subject: [PATCH] 8370851: Mark hotspot and jdk tests incompatible with test thread factory Reviewed-by: alanb, kevinw, sspitsyn --- test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java | 2 ++ .../jigsaw/classpathtests/EmptyClassInBootClassPath.java | 3 ++- .../appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java | 3 ++- .../sun/management/ThreadMXBean/ThreadAllocatedMemory.java | 4 +++- test/jdk/com/sun/net/httpserver/bugs/B6431193.java | 5 +++-- .../lang/management/ManagementFactory/ProxyTypeMapping.java | 3 ++- .../lang/management/ManagementFactory/ValidateOpenTypes.java | 3 ++- .../lang/management/ThreadMXBean/LockedMonitorInNative.java | 3 ++- test/jdk/java/lang/management/ThreadMXBean/Locks.java | 3 ++- .../lang/management/ThreadMXBean/ResetPeakThreadCount.java | 4 ++-- .../jdk/java/lang/management/ThreadMXBean/ThreadCpuTime.java | 3 ++- .../java/lang/management/ThreadMXBean/ThreadUserTime.java | 3 ++- test/jdk/java/nio/channels/SocketChannel/ShortWrite.java | 3 ++- 13 files changed, 28 insertions(+), 14 deletions(-) diff --git a/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java index 6ef7977ef8c..4789631ce62 100644 --- a/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java +++ b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java @@ -24,6 +24,7 @@ /** * @test * @summary Stress test that reaches the process limit for thread count, or time limit. + * @requires test.thread.factory == null * @requires os.family != "aix" * @key stress * @library /test/lib @@ -33,6 +34,7 @@ /** * @test * @summary Stress test that reaches the process limit for thread count, or time limit. + * @requires test.thread.factory == null * @requires os.family == "aix" * @key stress * @library /test/lib diff --git a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java index 32b435a34e4..c967176b22d 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ * app loader will load the class from the bootclasspath if the * "--limit-modules java.base" option is specified * @requires vm.cds & !vm.graal.enabled + * @requires test.thread.factory == null * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @modules java.base/jdk.internal.access * @compile ../../test-classes/EmptyClassHelper.java diff --git a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java index c86d5302d05..add9987b382 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ /** * @test * @requires vm.cds & !vm.graal.enabled & vm.cds.write.archived.java.heap + * @requires test.thread.factory == null * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @run driver OptimizeModuleHandlingTest * @summary test module path changes for optimization of diff --git a/test/jdk/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java b/test/jdk/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java index 3ff2a3baf17..0c185bf2dcc 100644 --- a/test/jdk/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java +++ b/test/jdk/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @bug 6173675 8231209 8304074 8313081 * @summary Basic test of ThreadMXBean.getThreadAllocatedBytes * @requires vm.gc.G1 + * @requires test.thread.factory != "Virtual" * @run main/othervm -XX:+UseG1GC ThreadAllocatedMemory */ @@ -34,6 +35,7 @@ * @bug 6173675 8231209 8304074 8313081 * @summary Basic test of ThreadMXBean.getThreadAllocatedBytes * @requires vm.gc.Serial + * @requires test.thread.factory != "Virtual" * @run main/othervm -XX:+UseSerialGC ThreadAllocatedMemory */ diff --git a/test/jdk/com/sun/net/httpserver/bugs/B6431193.java b/test/jdk/com/sun/net/httpserver/bugs/B6431193.java index 8b85aa4618c..f5b485d6a0a 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/B6431193.java +++ b/test/jdk/com/sun/net/httpserver/bugs/B6431193.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,8 +24,9 @@ /** * @test * @bug 6431193 - * @library /test/lib * @summary The new HTTP server exits immediately + * @requires test.thread.factory != "Virtual" + * @library /test/lib * @run main B6431193 * @run main/othervm -Djava.net.preferIPv6Addresses=true B6431193 */ diff --git a/test/jdk/java/lang/management/ManagementFactory/ProxyTypeMapping.java b/test/jdk/java/lang/management/ManagementFactory/ProxyTypeMapping.java index ed95bc89f7f..f222f51571f 100644 --- a/test/jdk/java/lang/management/ManagementFactory/ProxyTypeMapping.java +++ b/test/jdk/java/lang/management/ManagementFactory/ProxyTypeMapping.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @summary Test type mapping of the platform MXBean proxy * returned from Management.newPlatformMXBeanProxy(). * @author Mandy Chung + * @requires test.thread.factory != "Virtual" * * @compile ProxyTypeMapping.java * @run main/othervm -verbose:gc ProxyTypeMapping diff --git a/test/jdk/java/lang/management/ManagementFactory/ValidateOpenTypes.java b/test/jdk/java/lang/management/ManagementFactory/ValidateOpenTypes.java index f5ada9fe497..ffe99c46f66 100644 --- a/test/jdk/java/lang/management/ManagementFactory/ValidateOpenTypes.java +++ b/test/jdk/java/lang/management/ManagementFactory/ValidateOpenTypes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @summary Validate open types mapped for the MXBeans in the platform * MBeanServer. * @author Mandy Chung + * @requires test.thread.factory != "Virtual" * * @compile ValidateOpenTypes.java * @run main/othervm -verbose:gc ValidateOpenTypes diff --git a/test/jdk/java/lang/management/ThreadMXBean/LockedMonitorInNative.java b/test/jdk/java/lang/management/ThreadMXBean/LockedMonitorInNative.java index e1e490aa040..ef6f136266a 100644 --- a/test/jdk/java/lang/management/ThreadMXBean/LockedMonitorInNative.java +++ b/test/jdk/java/lang/management/ThreadMXBean/LockedMonitorInNative.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test * @summary Test ThreadMXBean.getLockedMonitors returns information about an object * monitor lock entered with a synchronized native method or JNI MonitorEnter + * @requires test.thread.factory != "Virtual" * @run junit/othervm LockedMonitorInNative */ diff --git a/test/jdk/java/lang/management/ThreadMXBean/Locks.java b/test/jdk/java/lang/management/ThreadMXBean/Locks.java index 5b4d360ae21..3bfa333fabd 100644 --- a/test/jdk/java/lang/management/ThreadMXBean/Locks.java +++ b/test/jdk/java/lang/management/ThreadMXBean/Locks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ * and ThreadInfo.getLockOwnerName() * @author Mandy Chung * @author Jaroslav Bachorik + * @requires test.thread.factory != "Virtual" * * @library /test/lib * diff --git a/test/jdk/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java b/test/jdk/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java index 996b5c94fcb..35a563909e2 100644 --- a/test/jdk/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java +++ b/test/jdk/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ * - ThreadMXBean.resetPeakThreadCount() * @author Mandy Chung * @author Jaroslav Bachorik - * + * @requires test.thread.factory != "Virtual" * @build ResetPeakThreadCount * @build ThreadDump * @run main/othervm ResetPeakThreadCount diff --git a/test/jdk/java/lang/management/ThreadMXBean/ThreadCpuTime.java b/test/jdk/java/lang/management/ThreadMXBean/ThreadCpuTime.java index f8cab540465..5def3f4ca57 100644 --- a/test/jdk/java/lang/management/ThreadMXBean/ThreadCpuTime.java +++ b/test/jdk/java/lang/management/ThreadMXBean/ThreadCpuTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @summary Basic test of ThreadMXBean.getThreadCpuTime and * getCurrentThreadCpuTime. * @author Mandy Chung + * @requires test.thread.factory != "Virtual" */ import java.lang.management.*; diff --git a/test/jdk/java/lang/management/ThreadMXBean/ThreadUserTime.java b/test/jdk/java/lang/management/ThreadMXBean/ThreadUserTime.java index 8f38ef8b1fb..ebbafa6541c 100644 --- a/test/jdk/java/lang/management/ThreadMXBean/ThreadUserTime.java +++ b/test/jdk/java/lang/management/ThreadMXBean/ThreadUserTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @summary Basic test of ThreadMXBean.getThreadUserTime and * getCurrentThreadUserTime. * @author Mandy Chung + * @requires test.thread.factory != "Virtual" */ import java.lang.management.*; diff --git a/test/jdk/java/nio/channels/SocketChannel/ShortWrite.java b/test/jdk/java/nio/channels/SocketChannel/ShortWrite.java index c1d7c33fc5d..5a6c4850aea 100644 --- a/test/jdk/java/nio/channels/SocketChannel/ShortWrite.java +++ b/test/jdk/java/nio/channels/SocketChannel/ShortWrite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @bug 7176630 7074436 * @summary Check for short writes on SocketChannels configured in blocking mode * @key randomness + * @requires test.thread.factory != "Virtual" */ import java.net.*;