JDK-8245517 : java/net/SocketOption/AfterClose.java fails with Invalid value 'READ_ONLY'
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2020-05-21
  • Updated: 2024-09-28
  • Resolved: 2020-05-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15 b25Fixed
Related Reports
Relates :  
Sub Tasks
JDK-8245518 :  
Description
java/net/SocketOption/AfterClose.java fails several times, all with similar exceptions:

test AfterClose.closedBoundDatagramSocket(SO_INCOMING_NAPI_ID, [READ_ONLY]): failure
java.lang.AssertionError: Expected IOException to be thrown, but IllegalArgumentException was thrown
	at org.testng.Assert.expectThrows(Assert.java:1013)
	at AfterClose.closedBoundDatagramSocket(AfterClose.java:254)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at org.testng.TestRunner.privateRun(TestRunner.java:773)
	at org.testng.TestRunner.run(TestRunner.java:623)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
	at org.testng.SuiteRunner.run(SuiteRunner.java:259)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
	at org.testng.TestNG.run(TestNG.java:1018)
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
	at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.IllegalArgumentException: Invalid value 'READ_ONLY'
	at java.base/sun.nio.ch.DatagramChannelImpl.setOption(DatagramChannelImpl.java:341)
	at java.base/sun.nio.ch.DatagramSocketAdaptor.setOption(DatagramSocketAdaptor.java:418)
	at java.base/java.net.DatagramSocket.setOption(DatagramSocket.java:983)
	at AfterClose.lambda$closedUnboundDatagramSocket$18(AfterClose.java:241)
	at org.testng.Assert.expectThrows(Assert.java:1005)
	... 29 more


Results for all the SO_INCOMING_NAPI_ID tests:
test AfterClose.closedBoundDatagramSocket(SO_INCOMING_NAPI_ID, [READ_ONLY]): failure
test AfterClose.closedBoundMulticastSocket(SO_INCOMING_NAPI_ID, [READ_ONLY]): failure
test AfterClose.closedDatagramAdapter(SO_INCOMING_NAPI_ID, [READ_ONLY]): failure
test AfterClose.closedServerSocketAdapter(SO_INCOMING_NAPI_ID, [READ_ONLY]): success
test AfterClose.closedServerSocketImplCreated(SO_INCOMING_NAPI_ID, [READ_ONLY]): success
test AfterClose.closedServerSocketImplUncreated(SO_INCOMING_NAPI_ID, [READ_ONLY]): success
test AfterClose.closedSocketAdapter(SO_INCOMING_NAPI_ID, [READ_ONLY]): success
test AfterClose.closedSocketImplCreated(SO_INCOMING_NAPI_ID, [READ_ONLY]): success
test AfterClose.closedSocketImplUncreated(SO_INCOMING_NAPI_ID, [READ_ONLY]): success
test AfterClose.closedUnboundDatagramSocket(SO_INCOMING_NAPI_ID, [READ_ONLY]): failure
test AfterClose.closedUnboundMulticastSocket(SO_INCOMING_NAPI_ID, [READ_ONLY]): failure
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/6d7c3a8bfab6 User: sviswanathan Date: 2020-05-22 17:27:21 +0000
22-05-2020

I'm going to guess that closedUnboundDatagramSocket needed the same change as applied to closedServerSocketAdapter.
21-05-2020