Integrated: 7903071: Jtreg plugin debug functionality broken in 2021.3

Maurizio Cimadamore mcimadamore at openjdk.java.net
Thu Dec 16 16:16:10 UTC 2021


On Fri, 3 Dec 2021 13:52:00 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: aad68cf2
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.java.net/jtreg/commit/aad68cf2ff023bc0e64057571467908e9b168492
Stats:     17 lines in 3 files changed: 10 ins; 2 del; 5 mod

7903071: Jtreg plugin debug functionality broken in 2021.3

Reviewed-by: jjg

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

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


More information about the jtreg-dev mailing list