Skip to content

Commit fde53fc

Browse files
committed
8310551: vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java timed out due to missing prompt
Reviewed-by: sspitsyn Backport-of: c84866a
1 parent 6d9da7c commit fde53fc

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

test/hotspot/jtreg/ProblemList.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,3 @@ vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manySame_b/TestDescription.java
174174
vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn001/forceEarlyReturn001.java 7199837 generic-all
175175

176176
vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Multi/Multi005/TestDescription.java 8076494 windows-x64
177-
178-
vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java 8310551 linux-all

test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2023, 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
@@ -89,7 +89,7 @@ public static int run(String argv[], PrintStream out) {
8989
static final String LAST_BREAK = DEBUGGEE_CLASS + ".breakHere";
9090
static final String MYTHREAD = "MyThread";
9191
static final String DEBUGGEE_THREAD = DEBUGGEE_CLASS + "$" + MYTHREAD;
92-
static final String DEBUGGEE_RESULT = DEBUGGEE_CLASS + ".notInterrupted.get()";
92+
static final String DEBUGGEE_RESULT = DEBUGGEE_CLASS + ".notInterrupted";
9393

9494
static int numThreads = nsk.jdb.interrupt.interrupt001.interrupt001a.numThreads;
9595

test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001a.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2023, 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
@@ -56,8 +56,8 @@ public void run() {
5656
lock.wait();
5757
}
5858
} catch (InterruptedException e) {
59-
notInterrupted.decrementAndGet();
6059
synchronized (waitnotify) {
60+
notInterrupted--;
6161
waitnotify.notify();
6262
}
6363
}
@@ -83,7 +83,7 @@ static void breakHere () {}
8383
private JdbArgumentHandler argumentHandler;
8484
private Log log;
8585

86-
public static final AtomicInteger notInterrupted = new AtomicInteger(numThreads);
86+
public static volatile int notInterrupted = numThreads;
8787

8888
public int runIt(String args[], PrintStream out) {
8989

@@ -122,8 +122,8 @@ public int runIt(String args[], PrintStream out) {
122122

123123
long waitTime = argumentHandler.getWaitTime() * 60 * 1000;
124124
long startTime = System.currentTimeMillis();
125-
while (notInterrupted.get() > 0 && System.currentTimeMillis() - startTime <= waitTime) {
126-
synchronized (waitnotify) {
125+
synchronized (waitnotify) {
126+
while (notInterrupted > 0 && System.currentTimeMillis() - startTime <= waitTime) {
127127
try {
128128
waitnotify.wait(waitTime);
129129
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)