RFR: 7903217: jtreg could try killing descendants of stuck test, before timing out the test
Gerard Ziemski
gziemski at openjdk.org
Mon Aug 22 17:11:50 UTC 2022
On Thu, 11 Aug 2022 20:32:36 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
>> This is an enhancement that aims to improve the robustness of the testing by attempting to quit any child processes (that are possibly stuck and are blocking the parent process from terminating) before timing out the target parent process.
>>
>> Aborting a process will flush its stdout/stderr streams, which will hopefully get captured in the test's log and provide additional clues as to why a test was timing out.
>>
>> This enhancement was locally tested with a handcrafted test that itself launched a child process that would get stuck on purpose and worked as intended.
>>
>> Hopefully, this will help debug issues such as [JDK-8286345](https://bugs.openjdk.org/browse/JDK-8286345)
>
> src/share/classes/com/sun/javatest/diff/SuperDiff.java line 286:
>
>> 284:
>> 285: final transient Set<String> platforms = new TreeSet<>();
>> 286: final transient Map<String, Info> infoTable = new HashMap<>();
>
> This seems totally unrelated
I wasn't able to compile jtreg without this modification, and I thought that including this change would help others in similar situation, but I can take it out and either leave it out completely or do a separate PR if you wish?
> src/share/classes/com/sun/javatest/regtest/exec/ProcessCommand.java line 267:
>
>> 265: long count = descendants.count();
>> 266: if (count > 0) {
>> 267: System.err.println("Detected a possibly stuck process (pid:"+pid+") with "+count+" descendants");
>
> Don't use `System.err` directly; use the `err` and `out` streams that were passed in when the class was invoked.
Thank you, will fix.
-------------
PR: https://git.openjdk.org/jtreg/pull/97
More information about the jtreg-dev
mailing list