diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java index 1794a2e9d31..40deb75b2fc 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, 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 @@ -141,10 +141,13 @@ public class strace001 { expectedSystemTrace = new String[]{ "java.lang.Thread.sleep", "java.lang.Thread.sleep0", + "java.lang.Thread.beforeSleep", + "java.lang.Thread.afterSleep", "java.lang.Thread.yield", "java.lang.Thread.yield0", "java.lang.Thread.currentCarrierThread", "java.lang.Thread.currentThread", + "java.util.concurrent.TimeUnit.toNanos", "jdk.internal.event.ThreadSleepEvent.", "jdk.internal.event.ThreadSleepEvent.isTurnedOn", "jdk.internal.event.ThreadSleepEvent.isEnabled" @@ -201,13 +204,15 @@ public class strace001 { // The method performs checks of the stack trace private static boolean checkTrace(StackTraceElement[] elements) { int length = elements.length; - int expectedLength = depth + 5; + // The length of the trace must not be greater than + // expectedLength. Number of recursionJava() or + // recursionNative() methods must not be greater than depth, + // also one run() and one waitForSign(), plus whatever can be + // reached from Thread.yield or Thread.sleep. + int expectedLength = depth + 6; boolean result = true; - // Check the length of the trace. It must not be greater than - // expectedLength. Number of recursionJava() or recursionNative() - // methods must not ne greater than depth, also one Object.wait() or - // Thread.yield() method, one run( ) and one waitForSign(). + // Check the length of the trace if (length > expectedLength) { log.complain("Length of the stack trace is " + length + ", but " + "expected to be not greater than " + expectedLength); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001/TestDescription.java index a9af73eed2b..53b73954af5 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,10 +42,9 @@ * Main thread makes a snapshot of stack trace for all threads and checks it: * 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must * return not null ThreadInfo. - * 2. The length of a trace must not be greater than (depth + 3). Number - * of recursionJava() or recursionNative() methods must not be greater - * than depth, also one Object.wait() or Thread.yield() method, one - * run(), and one waitForSign(). + * 2. Number of recursionJava() or recursionNative() methods must not be + * greater than depth + X, where X is implementation dependent. + * See strace001.java for more info. * 3. The latest method of the stack trace must be RunningThread.run(). * 4. getClassName() and getMethodName() methods must return expected * values for each element of the stack trace. diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace002/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace002/TestDescription.java index 044f0b7a78d..b41fb5f76f8 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace002/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace002/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,10 +42,9 @@ * Main thread makes a snapshot of stack trace for all threads and checks it: * 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must * return not null ThreadInfo. - * 2. The length of a trace must not be greater than (depth + 3). Number - * of recursionJava() or recursionNative() methods must not be greater - * than depth, also one Object.wait() or Thread.yield() method, one - * run(), and one waitForSign(). + * 2. Number of recursionJava() or recursionNative() methods must not be + * greater than depth + X, where X is implementation dependent. + * See strace001.java for more info. * 3. The latest method of the stack trace must be RunningThread.run(). * 4. getClassName() and getMethodName() methods must return expected * values for each element of the stack trace. diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace003/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace003/TestDescription.java index e973e4404b1..c39f4dde2af 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace003/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace003/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,10 +42,9 @@ * Main thread makes a snapshot of stack trace for all threads and checks it: * 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must * return not null ThreadInfo. - * 2. The length of a trace must not be greater than (depth + 3). Number - * of recursionJava() or recursionNative() methods must not be greater - * than depth, also one Object.wait() or Thread.yield() method, one - * run(), and one waitForSign(). + * 2. Number of recursionJava() or recursionNative() methods must not be + * greater than depth + X, where X is implementation dependent. + * See strace001.java for more info. * 3. The latest method of the stack trace must be RunningThread.run(). * 4. getClassName() and getMethodName() methods must return expected * values for each element of the stack trace. diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace004/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace004/TestDescription.java index 60b0eb69867..8edd13c21d4 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace004/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace004/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,10 +42,9 @@ * Main thread makes a snapshot of stack trace for all threads and checks it: * 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must * return not null ThreadInfo. - * 2. The length of a trace must not be greater than (depth + 3). Number - * of recursionJava() or recursionNative() methods must not be greater - * than depth, also one Object.wait() or Thread.yield() method, one - * run(), and one waitForSign(). + * 2. Number of recursionJava() or recursionNative() methods must not be + * greater than depth + X, where X is implementation dependent. + * See strace001.java for more info. * 3. The latest method of the stack trace must be RunningThread.run(). * 4. getClassName() and getMethodName() methods must return expected * values for each element of the stack trace. diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace005/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace005/TestDescription.java index 93f63ad85c4..0309ee2936b 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace005/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace005/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,10 +42,9 @@ * Main thread makes a snapshot of stack trace for all threads and checks it: * 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must * return not null ThreadInfo. - * 2. The length of a trace must not be greater than (depth + 3). Number - * of recursionJava() or recursionNative() methods must not be greater - * than depth, also one Object.wait() or Thread.yield() method, one - * run(), and one waitForSign(). + * 2. Number of recursionJava() or recursionNative() methods must not be + * greater than depth + X, where X is implementation dependent. + * See strace001.java for more info. * 3. The latest method of the stack trace must be RunningThread.run(). * 4. getClassName() and getMethodName() methods must return expected * values for each element of the stack trace. diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace006/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace006/TestDescription.java index be2418921e3..e161cd18162 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace006/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace006/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,10 +42,9 @@ * Main thread makes a snapshot of stack trace for all threads and checks it: * 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must * return not null ThreadInfo. - * 2. The length of a trace must not be greater than (depth + 3). Number - * of recursionJava() or recursionNative() methods must not be greater - * than depth, also one Object.wait() or Thread.yield() method, one - * run(), and one waitForSign(). + * 2. Number of recursionJava() or recursionNative() methods must not be + * greater than depth + X, where X is implementation dependent. + * See strace001.java for more info. * 3. The latest method of the stack trace must be RunningThread.run(). * 4. getClassName() and getMethodName() methods must return expected * values for each element of the stack trace. diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace007/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace007/TestDescription.java index 170d7cd737c..8d788dde42c 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace007/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace007/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,10 +42,9 @@ * Main thread makes a snapshot of stack trace for all threads and checks it: * 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must * return not null ThreadInfo. - * 2. The length of a trace must not be greater than (depth + 3). Number - * of recursionJava() or recursionNative() methods must not be greater - * than depth, also one Object.wait() or Thread.yield() method, one - * run(), and one waitForSign(). + * 2. Number of recursionJava() or recursionNative() methods must not be + * greater than depth + X, where X is implementation dependent. + * See strace001.java for more info. * 3. The latest method of the stack trace must be RunningThread.run(). * 4. getClassName() and getMethodName() methods must return expected * values for each element of the stack trace. diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace008/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace008/TestDescription.java index 4573ec83968..b918966976c 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace008/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace008/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,10 +42,9 @@ * Main thread makes a snapshot of stack trace for all threads and checks it: * 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must * return not null ThreadInfo. - * 2. The length of a trace must not be greater than (depth + 3). Number - * of recursionJava() or recursionNative() methods must not be greater - * than depth, also one Object.wait() or Thread.yield() method, one - * run(), and one waitForSign(). + * 2. Number of recursionJava() or recursionNative() methods must not be + * greater than depth + X, where X is implementation dependent. + * See strace001.java for more info. * 3. The latest method of the stack trace must be RunningThread.run(). * 4. getClassName() and getMethodName() methods must return expected * values for each element of the stack trace. diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace009/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace009/TestDescription.java index d7efb152ec0..dbfd033f9cc 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace009/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace009/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, 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 @@ -42,10 +42,9 @@ * Main thread makes a snapshot of stack trace for all threads and checks it: * 1. If a thread is alive, ThreadMonitor.getThreadInfo(long, -1) must * return not null ThreadInfo. - * 2. The length of a trace must not be greater than (depth + 3). Number - * of recursionJava() or recursionNative() methods must not be greater - * than depth, also one Object.wait() or Thread.yield() method, one - * run(), and one waitForSign(). + * 2. Number of recursionJava() or recursionNative() methods must not be + * greater than depth + X, where X is implementation dependent. + * See strace001.java for more info. * 3. The latest method of the stack trace must be RunningThread.run(). * 4. getClassName() and getMethodName() methods must return expected * values for each element of the stack trace.