Withdrawn: 8347756: Re-evaluate the java/net/DatagramSocket/InterruptibleDatagramSocket.java test
duke
duke at openjdk.org
Wed Mar 19 20:00:14 UTC 2025
On Wed, 15 Jan 2025 13:21:30 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
> Can I please get a review of this test-only change which updates the `test/jdk/java/net/DatagramSocket/InterruptibleDatagramSocket.java` to match the specified behaviour of `DatagramSocket.receive()` method?
>
> This test was introduced in Java 14 (https://bugs.openjdk.org/browse/JDK-8233018) and that version of Java through Java 18, behave differently when a DatagramSocket associated with a DatagramChannel, when blocked in a receive() is interrupted. In those versions, a `SocketException` gets thrown with `ClosedByInterruptException` as the cause of that `SocketException`.
>
> Starting Java 19, the specification of DatagramSocket.receive() has been updated to clarify the expectations of this scenario. Given those updates, the DatagramSocket.receive() is expected to throw a (top level) `ClosedByInterruptException` when associated with a `DatagramChannel`.
>
> The change in this PR updates the test code to no longer expect a `SocketException` to contain the `ClosedByInterruptException`. With this change the test continues to pass both with platform threads as well as virtual threads. The test will no longer be skipped when the main() is launched through a virtual thread.
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.org/jdk/pull/23135
More information about the net-dev
mailing list