8375076: Two JDI scenario tests are failing with out of wait time after completing successfully

Reviewed-by: sspitsyn, dholmes
This commit is contained in:
Chris Plummer 2026-05-29 17:05:56 +00:00
parent d4b6c78f3a
commit 2fa9eb6764
6 changed files with 33 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -227,5 +227,10 @@ public class tc02x004 {
display("");
brkpEventCount++;
if (brkpEventCount == tc02x004a.threadCount) {
// When done we disable the MethodEntryRequest because we don't
// want it enabled while the debuggee exits. See JDK-8375076 and JDK-8384569.
event.request().disable();
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -209,6 +209,14 @@ public class tc04x001 {
display("\tmethod\t- " + event.location().method().name());
display("\tline\t- " + event.location().lineNumber());
// When done() is called we disable the MethodEntryRequest because we don't
// want it enabled while the debuggee exits. See JDK-8375076 and JDK-8384569.
if (event.method().name().equals("done")) {
display("done() called - disabling MethodEntryRequest\n");
event.request().disable();
return;
}
if (!event.method().name().equals(methodName)) {
display("the event skipped, method - " + event.method().name() + "\n");
return;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -29,14 +29,14 @@ import nsk.share.jdi.*;
// THIS TEST IS LINE NUMBER SENSITIVE
/**
* <code>tc04x001a</code> is deugee's part of the tc04x001.
* <code>tc04x001a</code> is debugee's part of the tc04x001.
*/
public class tc04x001a {
public final static int threadCount = 3;
static Log log;
public final static int checkMethodBrkpLine = 73;
public final static int checkMethodBrkpLine = 74;
Thread[] thrds = new Thread[threadCount];
public static void main (String argv[]) {
@ -58,6 +58,7 @@ public class tc04x001a {
System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);
}
}
done(); // Signal the disabling of MethodEntryRequest
log.display("completed succesfully.");
System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);
}
@ -77,6 +78,10 @@ public class tc04x001a {
log.display(caller + "::bar is called");
}
public static void done() {
log.display("done is called");
}
static class Thready extends NamedTask {
Thready(String name) {
super(name);

View File

@ -160,10 +160,9 @@ public class popframes001 {
if (eventIterator != null) {
while (eventIterator.hasNext()) {
event = eventIterator.nextEvent();
// display("\nevent ===>>> " + event);
display("\nevent ===>>> " + event);
if (event instanceof ClassPrepareEvent) {
display("\nevent ===>>> " + event);
testedClass = (ClassType )debugee.classByName(testedClassName);
debugeeClass = (ClassType )debugee.classByName(debugeeName);
@ -179,11 +178,9 @@ public class popframes001 {
debugee.resume();
} else if (event instanceof MethodExitEvent) {
display("\nevent ===>>> " + event);
hitMethodExitEvent((MethodExitEvent )event);
} else if (event instanceof MethodEntryEvent) {
display("\nevent ===>>> " + event);
hitMethodEntryEvent((MethodEntryEvent )event);
display("\nresuming...");
debugee.resume();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
@ -30,7 +30,7 @@ import nsk.share.jdi.*;
import java.io.*;
/**
* <code>popframes001a</code> is deugee's part of the popframes001.
* <code>popframes001a</code> is debugee's part of the popframes001.
*/
public class popframes001a {
@ -38,6 +38,11 @@ public class popframes001a {
volatile public static boolean finishIt = false;
public static void main(String argv[]) {
// The following will cause intialization of a bunch of classes before we
// enable MethodEntry/Exit events, which would otherwise result in long test runs.
// See JDK-8375076 and JDK-8384569.
System.getLogger("java.lang.Runtime");
ArgumentHandler argHandler = new ArgumentHandler(argv);
Log log = new Log(System.out, argHandler);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 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
@ -408,6 +408,7 @@ public class popframes003 extends JDIBase {
}
log2("......disabling requests and resuming vm");
meRequest.disable();
meRequest3.disable();
vm.resume();