RFR: 8354554: Open source several clipboard tests batch1 [v2]
Sergey Bylokhov
serb at openjdk.org
Wed Apr 23 22:34:51 UTC 2025
On Wed, 23 Apr 2025 22:22:21 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:
>> test/jdk/java/awt/Clipboard/LostOwnershipChainTest/SystemClipboard2ProcTest.java line 117:
>>
>>> 115: OutputAnalyzer outputAnalyzer = new OutputAnalyzer(process);
>>> 116:
>>> 117: if (!process.waitFor(15, TimeUnit.SECONDS)) {
>>
>> In case of error it will be good to kill the child process via destroyForcibly(), or you can use
>> `OputAnalyzer executeTestJava(String... command)`
>> which will create the builder, then waits till completion and kill child process in case of errors.
>
> I prefer an early timeout, but `ProcessTools.executeProcess()` doesn't allow to set it, so `destroyForcibly()` was added.
That looks fine. I guess people usually set that timeout via a jtreg parameter, and then executeProcess kills the child process when jtreg shuts down the test.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24806#discussion_r2056950654
More information about the client-libs-dev
mailing list