RFR: 8297302: gtest/AsyncLogGtest.java fails AsyncLogTest.stdoutOutput_vm
David Holmes
dholmes at openjdk.org
Thu Apr 20 07:14:44 UTC 2023
On Wed, 19 Apr 2023 06:32:51 GMT, Xin Liu <xliu at openjdk.org> wrote:
> This patch tries to resolve the intermittent failures. gtest uses mktemp and dup/dup2 to implement CapturedStream.
> The mechanism may fail in temp file or the current process happens to run out of file descriptor. It's possible that
> GetCapturedStream() returns an empty string and it confuses write_to_file().
>
> This patch strengthens write_to_file() in the following 2 ways. The test skips content check if write_to_file()
> returtn false.
> 1. at least see a non-empty string from stdout/stderr. we write a string "header" to stdout/stderr.
> 2. flush all streams before calling GetCapturedStream()
Seems a reasonable attempt to make the test more robust. Thanks.
-------------
Marked as reviewed by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/13524#pullrequestreview-1393342092
More information about the hotspot-runtime-dev
mailing list