RFR: 8377729: Running jtreg tests with -agent... option causes some tests to fail due to duplicate -agent options provided to a subprocess [v2]

Kirill Shirokov kshiroko at openjdk.org
Sat Feb 14 02:37:26 UTC 2026


On Thu, 12 Feb 2026 04:51:10 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

>> Kirill Shirokov has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Remove trailing whitespace
>>  - Removed duplicate VM options from test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java, test/jdk/sun/tools/jstack/DeadlockDetectionTest.java, test/lib/jdk/test/lib/apps/LingeredApp.java, test/lib/jdk/test/lib/cli/CommandLineOptionTest.java. Added duplicate agent options warning to ProcessTools-spawned subprocesses and LingeredApp
>
> test/lib/jdk/test/lib/apps/LingeredApp.java line 49:
> 
>> 47: import jdk.test.lib.Utils;
>> 48: import jdk.test.lib.process.OutputBuffer;
>> 49: import jdk.test.lib.process.ProcessTools;
> 
> I don't think that it is good idea to deduplicate options in ProcessTools.
> 
> Better to fix the tests that duplicate options rather then try to deduplicate all options.

I fixed individual tests. Removed deduplication, but kept the check for duplicate agent arguments in place (now it just prints a message to stderr)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29684#discussion_r2806818285


More information about the core-libs-dev mailing list