RFR: 7903071: Jtreg plugin debug functionality broken in 2021.3

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri Dec 3 13:58:47 UTC 2021


IntelliJ 2021.3 changed the order in which certain plugin methods are called when debugging a jtreg test. More specifically, the `JtregDebuggerRunner::createContentDescriptor` method is called _after_ `JTRegConfigurationRunnableState::createJavaParameters`. Since the former sets up the debugging port which has then to be passed to the jtreg command line (in the latter), this means that, in 2021.3 we end up creating a command line that is broken because it has either no port (when we debug for the first time) or a stale port (when we debug subsequent times).

I discussed this with Anna Kozlova and, while jtreg is a bit peculiar compared to other debugging plugin (as jtreg spawns other VMs, which is why we need to create a command line which includes the port number), it is possible to fix this in a way that is also compatible with older versions - by overriding `JtregDebuggerRunner::execute`, which is called before the other two methods. So we can setup the port number in there - and then reuse port number in the subsequent calls.

-------------

Commit messages:
 - Fix debugging issues when using 2021.3
 - Update README.md
 - Fix link syntax
 - Update toplevel readme

Changes: https://git.openjdk.java.net/jtreg/pull/44/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jtreg&pr=44&range=00
  Issue: https://bugs.openjdk.java.net/browse/CODETOOLS-7903071
  Stats: 21 lines in 5 files changed: 10 ins; 3 del; 8 mod
  Patch: https://git.openjdk.java.net/jtreg/pull/44.diff
  Fetch: git fetch https://git.openjdk.java.net/jtreg pull/44/head:pull/44

PR: https://git.openjdk.java.net/jtreg/pull/44


More information about the jtreg-dev mailing list