Replaces the fixed delay in `IsAvailable.java` with reads from the socket used 
by `HttpClient::available`.
The tests wait for EOF or data on that socket before invoking the existing 
`HttpClient::available` assertion.

No production code is changed.

Testing:
- `make test TEST='test/jdk/sun/net/www/http/HttpClient/IsAvailable.java' 
JTREG='REPEAT_COUNT=200;VERBOSE=summary;RETAIN=fail'` (200/200 passed)
- `make test TEST='test/jdk/sun/net/www/http/HttpClient/IsAvailable.java' 
JTREG='VERBOSE=summary;RETAIN=fail;VM_OPTIONS=-Dsun.net.client.defaultReadTimeout=200'`
 (passed)

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

-------------

Commit messages:
 - 8390064: Stabilize IsAvailable test

Changes: https://git.openjdk.org/jdk/pull/32539/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=32539&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8390064
  Stats: 44 lines in 1 file changed: 40 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/32539.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32539/head:pull/32539

PR: https://git.openjdk.org/jdk/pull/32539

Reply via email to