RFR: 8338469: com/sun/jdi/DataDumpTest.java failed with Not a debuggee, or not listening for debugger to attach
Chris Plummer
cjplummer at openjdk.org
Thu Aug 15 22:08:17 UTC 2024
There are issues with the test attaching to the debuggee too soon, and the debug agent isn't ready. yet. This test is based on ProcessAttachTest, which does not have this issue. I eventually realized the reason why is because ProcessAttachTest has this little snippet of code, which I had removed from DataDumpTest:
// Wait for the process to start
InputStream is = p.getInputStream();
is.read();
This is waiting for the start of the debug agent's "Listening..." message. I've re-added this to DataDumpTest, and it seems to fix the issue. Tested by running 20 times with `-Xcomp` on all supported platforms with no failures. It used to fail about 2/3 of the time.
-------------
Commit messages:
- Wait until first character can be read before trying to attach to debuggee process.
Changes: https://git.openjdk.org/jdk/pull/20604/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20604&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8338469
Stats: 6 lines in 1 file changed: 5 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/20604.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/20604/head:pull/20604
PR: https://git.openjdk.org/jdk/pull/20604
More information about the serviceability-dev
mailing list