From 12894a870a3c8d1da13a885cc006458ae9475b6e Mon Sep 17 00:00:00 2001 From: Serguei Spitsyn Date: Sat, 10 Jan 2026 11:10:06 +0000 Subject: [PATCH] 8373643: Test serviceability/jvmti/vthread/ThreadListStackTracesTest/ThreadListStackTracesTest.java still failing Reviewed-by: lmesnik --- .../ThreadListStackTracesTest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/jvmti/vthread/ThreadListStackTracesTest/ThreadListStackTracesTest.java b/test/hotspot/jtreg/serviceability/jvmti/vthread/ThreadListStackTracesTest/ThreadListStackTracesTest.java index 079f65620d8..2a5c9bea111 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/vthread/ThreadListStackTracesTest/ThreadListStackTracesTest.java +++ b/test/hotspot/jtreg/serviceability/jvmti/vthread/ThreadListStackTracesTest/ThreadListStackTracesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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 @@ -45,8 +45,9 @@ abstract class TestTask implements Runnable { } public void ensureReadyAndWaiting(Thread vt, Thread.State expState, ReentrantLock rlock) { + sleep(50); // reliability: wait for a potential class loading to complete // wait while the thread is not ready or thread state is unexpected - while (!threadReady || (vt.getState() != expState) || !rlock.hasQueuedThreads()) { + while (!threadReady || (vt.getState() != expState) || !rlock.hasQueuedThread(vt)) { sleep(1); } } @@ -125,11 +126,12 @@ public class ThreadListStackTracesTest { int jvmtiExpState = (expState == Thread.State.WAITING) ? JVMTI_THREAD_STATE_WAITING : JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER; + Thread.State state = vt.getState(); - System.out.printf("State: expected: %s single: %x multi: %x\n", - vt.getState(), singleState, multiState); + System.out.printf("State: expected: %s, vt.getState(): %s, jvmtiExpState: %x single: %x multi: %x\n", + expState, state, jvmtiExpState, singleState, multiState); - if (vt.getState() != expState) { + if (state != expState) { failed("Java thread state is wrong"); } if ((singleState & jvmtiExpState) == 0) {