This PR fixes an intermittent test failure on Windows. The test server used in 
HttpURLConnectionExpect100Test now reads from the socket until the client 
closes it.

The current implementation closes the server socket after reading the request 
headers, but without reading the request body. On Windows, if any data is left 
in the socket receive buffer when the socket is closed, the connection is 
reset. If the client doesn't read the response before the connection is reset, 
the response is lost and the test fails.

Verified that:
- the test still passes
- waiting for the client to close the socket does not take excessive amounts of 
time (the test finishes in half a second on my machine)

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

Commit messages:
 - Drain the socket before closing

Changes: https://git.openjdk.org/jdk/pull/21948/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21948&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8343411
  Stats: 25 lines in 1 file changed: 7 ins; 15 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/21948.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21948/head:pull/21948

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

Reply via email to