On Fri, 20 Feb 2026 13:59:37 GMT, Daniel Fuchs <[email protected]> wrote:
>> test/jdk/java/net/httpclient/AggregateRequestBodyTest.java line 159:
>>
>>> 157: }
>>> 158:
>>> 159: static final class TestStopper implements TestWatcher,
>>> BeforeEachCallback {
>>
>> We shouldn't be copy-pasting such a basic(?) JUnit operator. I will check
>> following options in preference order:
>>
>> 1. Does JUnit provide a feature to _"stop after failure"_?
>> 2. If not, could JUnit maintainers add such a feature? (We can also
>> contribute this, granted they approve the design.)
>> 3. If not, add this to `/test/lib`.
>
> It's not worse than the previous boiler plate. It's in fact much better. It
> was suggested by @sormuras .
A custom `TestStopper` (reusable as a library class in `/test/lib`) is the best
we can do at the moment, without upgrading `jtreg` to bundle JUnit 6 (providing
such a feature at the test engine level - at the cost of Java 17 baseline) and
without introducing a new 3rd-party dependency to, for example, JUnit Pioneer
with its https://junit-pioneer.org/docs/disable-if-test-fails/ annotation.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29786#discussion_r2833871059