The test expects that stopping the client will cause an attempt to read from a connected channel to return -1. With Java 17 on Windows the connection has been reset and a SocketException is thrown instead. This seems reasonable as stopping the client closes the ServerSocketChannel to which the test was connected. We should update the test to expect a SocketException or a return value of -1.