https://bz.apache.org/bugzilla/show_bug.cgi?id=65410
Bug ID: 65410
Summary: TestXxxEndpoint testUnixDomainSocket fails with an
Error on Windows 10, should be skipped
Product: Tomcat 9
Version: unspecified
Hardware: PC
Status: NEW
Severity: minor
Priority: P2
Component: Connectors
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -----
Testing release candidate of Tomcat 9.0.50,
when running with Java 16 on Windows 10, the following test fails with NIO
connector:
org.apache.tomcat.util.net.TestXxxEndpoint#testUnixDomainSocket
Notes:
1. This test is skipped when running with version of Java earlier than java 16.
This test is skipped for any connector implementation besides NIO.
2. I think this failure is expected on Windows,
so there is one more condition to check before skipping the test.
3. I wonder, why this feature is not implemented for NIO2 connector.
- It is implemented for NIO. (via original PR, since 9.0.42)
- It is implemented for APR. (via bug 64943, since 9.0.47)
Searching through the source code, "unixDomainSocketPath" properties are
implemented in
- AprEndpoint,
- NioEndpoint.
4. Missing docs: "unixDomainSocketPath", "unixDomainSocketPathPermissions"
attributes are documented for the Nio connector only. They are not documented
for the APR connector.
https://tomcat.apache.org/tomcat-9.0-doc/config/http.html
5. I wonder, why this test is skipped for an APR connector,
if it implements the feature.
The Error with the test looks like the following (Tomcat 9.0.50, OpenJDK
16.0.1):
[[[
Testsuite: org.apache.tomcat.util.net.TestXxxEndpoint
Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2,621 sec
------------- Standard Error -----------------
30-Jun-2021 00:28:34.827 INFO [main]
org.apache.catalina.startup.LoggingBaseTest.setUp Starting test case
[testUnixDomainSocket]
30-Jun-2021 00:28:35.323 INFO [main] org.apache.coyote.AbstractProtocol.init
Initializing ProtocolHandler ["http-nio-/tmp/testUnixDomainSocket"]
30-Jun-2021 00:28:35.355 SEVERE [main]
org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to
initialize component [Connector[HTTP/1.1-/tmp/testUnixDomainSocket]]
org.apache.catalina.LifecycleException: Protocol handler initialization
failed
at
org.apache.catalina.connector.Connector.initInternal(Connector.java:1049)
at
org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at
org.apache.catalina.core.StandardService.initInternal(StandardService.java:561)
at
org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at
org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1049)
at
org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
at
org.apache.catalina.startup.TomcatBaseTest$TomcatWithFastSessionIDs.start(TomcatBaseTest.java:878)
at
org.apache.tomcat.util.net.TestXxxEndpoint.testUnixDomainSocket(TestXxxEndpoint.java:209)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at
org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at
org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at
org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at
org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at
org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at
junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:50)
at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:535)
at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1197)
at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1042)
Caused by: java.net.SocketException: Network is down: bind
at java.base/sun.nio.ch.UnixDomainSockets.bind0(Native Method)
at
java.base/sun.nio.ch.UnixDomainSockets.bind(UnixDomainSockets.java:111)
at
java.base/sun.nio.ch.ServerSocketChannelImpl.unixBind(ServerSocketChannelImpl.java:319)
at
java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:292)
at
org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:250)
at
org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:227)
at
org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1208)
at
org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1221)
at
org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:603)
at
org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:80)
at
org.apache.catalina.connector.Connector.initInternal(Connector.java:1046)
... 38 more
[...]
------------- ---------------- ---------------
Testcase: testUnixDomainSocket took 1,117 sec
Caused an ERROR
Network is down: connect
java.net.SocketException: Network is down: connect
at java.base/sun.nio.ch.UnixDomainSockets.connect0(Native Method)
at
java.base/sun.nio.ch.UnixDomainSockets.connect(UnixDomainSockets.java:146)
at
java.base/sun.nio.ch.UnixDomainSockets.connect(UnixDomainSockets.java:142)
at
java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:849)
at
org.apache.tomcat.util.net.TestXxxEndpoint.testUnixDomainSocket(TestXxxEndpoint.java:214)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Testcase: testStartStopBindOnStart took 1,131 sec
Testcase: testStartStopBindOnInit took 0,304 sec
]]]
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]