[JDK-8385924: GZIPInputStream.read() behaves differently on some Java versions](https://bugs.openjdk.org/browse/JDK-8385924) introduced the new system property `jdk.util.gzip.tryReadAheadAfterTrailer` which defaults to `false` and restores the behavior of `GZIPInputStream` when reading multi-member gzip streams to the before-JDK25 (and JDK 27+) state. When the property is set to `true`, GZIPInputStream will behave like in JDK 25.
Currently, some of the new `GZIPInputStream` JTreg tests which specifically test the non-blocking behavior of `GZIPInputStream` rely on the fact that `jdk.util.gzip.tryReadAheadAfterTrailer` is set to `false`. We should make testing more resilient and allow testing with `jdk.util.gzip.tryReadAheadAfterTrailer=true` without errors or timeouts. Tested with: - `make test TEST=test/jdk/java/util/zip/GZIP JTREG="OPTIONS=-javaoption:-Djdk.util.gzip.tryReadAheadAfterTrailer=false"` - `make test TEST=test/jdk/java/util/zip/GZIP JTREG="OPTIONS=-javaoption:-Djdk.util.gzip.tryReadAheadAfterTrailer=true"` --------- - [x] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). ------------- Commit messages: - 8387769: GZIPInputStream tests should succeed with tryReadAheadAfterTrailer true and false Changes: https://git.openjdk.org/jdk/pull/31790/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=31790&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8387769 Stats: 16 lines in 2 files changed: 13 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/31790.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/31790/head:pull/31790 PR: https://git.openjdk.org/jdk/pull/31790
