On Mon, 22 Jul 2024 15:33:27 GMT, Sonia Zaldana Calles <[email protected]>
wrote:
>> test/hotspot/jtreg/serviceability/dcmd/compiler/PerfMapTest.java line 124:
>>
>>> 122: OutputAnalyzer output = new
>>> JMXExecutor().execute("Compiler.perfmap %s".formatted(path));
>>> 123: output.shouldContain("Failed to create nonexistent/%s for
>>> perf map".formatted(test_dir));
>>> 124: output.shouldNotHaveExitValue(0);
>>
>> I'm curious if this exit value check works, as jcmd failures like this show
>> "Command executed successfully" and return 0 for success.
>> These compiler tests have chosen JMXExecutor and PidJcmdExecutor which might
>> be relevant. Interested to know if JMXExecutor returns a non-zero exit
>> value for this?
>
> Hi Kevin,
>
> Yes, I noticed the test was exiting with a non-zero value when I was testing.
> After giving it a bit more thought, that check is not the main purpose of the
> test and I'm not entirely sure why the JMXExecutor behaves that way. I'll
> just remove the exit value check to avoid confusion.
I think it was returning an "exit value" of -1, the
test/lib/jdk/test/lib/process/OutputBuffer.java default.
JMXExecutor doesn't set one as there isn't an exit code... That could be
clearer, actually there must be various issues in that area. But yes just
don't check exit code for a JMX Executor, and jcmd would return zero but we
don't want to embed that as a requirement, it's really a failure.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20257#discussion_r1686829542