The LineBodyHandlerTest.java creates and discards many clients (64).
The test has been observed failing intermittently on some systems (Windows 10) while trying to open the client's selector, apparently due to some connection limit (see below).
It seems that using a single client reduces the occurrences in which the test fails.
java.io.IOException: Unable to establish loopback connection
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:99)
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:65)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at java.base/sun.nio.ch.PipeImpl.<init>(PipeImpl.java:188)
at java.base/sun.nio.ch.WEPollSelectorImpl.<init>(WEPollSelectorImpl.java:78)
at java.base/sun.nio.ch.WEPollSelectorProvider.openSelector(WEPollSelectorProvider.java:33)
at java.base/java.nio.channels.Selector.open(Selector.java:295)
at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.<init>(HttpClientImpl.java:719)
at java.net.http/jdk.internal.net.http.HttpClientImpl.<init>(HttpClientImpl.java:323)
... 33 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.base/sun.nio.ch.Net.connect0(Native Method)
at java.base/sun.nio.ch.Net.connect(Net.java:579)
at java.base/sun.nio.ch.Net.connect(Net.java:586)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:853)
at java.base/java.nio.channels.SocketChannel.open(SocketChannel.java:285)
at java.base/sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:129)
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:81)