Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extended.openjdk failure: com/sun/jndi/ldap/LdapDnsProviderTest.java.LdapDnsProviderTest #2350

Open
andrew-m-leonard opened this issue Mar 10, 2021 · 13 comments

Comments

@andrew-m-leonard
Copy link
Contributor

com/sun/jndi/ldap/LdapDnsProviderTest.java.LdapDnsProviderTest
https://ci.adoptopenjdk.net/job/Test_openjdk8_j9_extended.openjdk_aarch64_linux/9/testReport/junit/com_sun_jndi_ldap_LdapDnsProviderTest/java/LdapDnsProviderTest_2/
Fails Hotspot and OpenJ9

01:37:37  openjdk version "1.8.0_292"
01:37:37  OpenJDK Runtime Environment (build 1.8.0_292-202103091148-b05)
01:37:37  Eclipse OpenJ9 VM (build openj9-0.26.0-m1, JRE 1.8.0 Linux aarch64-64-Bit Compressed References 20210309_235 (JIT enabled, AOT enabled)
01:37:37  OpenJ9   - b227feba2
01:37:37  OMR      - 4665e2f72
01:37:37  JCL      - 1780cbc92b based on jdk8u292-b05)
01:48:22  Testing: ldap://localhost:111/dc=example,dc=com, localhost:111
01:48:22  javax.naming.NamingException: LDAP connection has been closed
01:48:22  	at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:133)
01:48:22  	at com.sun.jndi.ldap.Connection.readReply(Connection.java:469)
01:48:22  	at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:365)
01:48:22  	at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:192)
01:48:22  	at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2897)
01:48:22  	at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:347)
01:48:22  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:225)
01:48:22  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:189)
01:48:22  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:243)
01:48:22  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
01:48:22  	at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
01:48:22  	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
01:48:22  	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
01:48:22  	at javax.naming.InitialContext.init(InitialContext.java:244)
01:48:22  	at javax.naming.InitialContext.<init>(InitialContext.java:216)
01:48:22  	at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101)
01:48:22  	at ProviderTest.call(LdapDnsProviderTest.java:108)
01:48:22  	at ProviderTest.call(LdapDnsProviderTest.java:78)
01:48:22  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
01:48:22  	at java.lang.Thread.run(Thread.java:823)
01:48:22  Test failed
01:48:22  Test failed
01:48:22  java.lang.RuntimeException: Test failed, unexpected result
01:48:22  	at LdapDnsProviderTest.runTest(LdapDnsProviderTest.java:221)
01:48:22  	at LdapDnsProviderTest.main(LdapDnsProviderTest.java:196)
01:48:22  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
01:48:22  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
01:48:22  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
01:48:22  	at java.lang.reflect.Method.invoke(Method.java:498)
01:48:22  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
01:48:22  	at java.lang.Thread.run(Thread.java:823)

Suspect upstream issue?

@lumpfish
Copy link
Contributor

Also seen on jdk8 ppcle_linux and s390x_linux:

openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b09)
Eclipse OpenJ9 VM (build master-ee83667b9, JRE 1.8.0 Linux ppc64le-64-Bit Compressed References 20210410_936 (JIT enabled, AOT enabled)
OpenJ9   - ee83667b9
OMR      - d7a31696c
JCL      - bf7a0585ab0 based on jdk8u292-b09)

@lumpfish
Copy link
Contributor

Some more investigation:

  1. The test fails on test-osuosl-ubuntu1604-ppc64le-2 but passes on test-osuosl-centos74-ppc64le-1.
  2. When the test fails, there is an additional exception (Connection refused) in the test output. This is not reported as a test failure, but may provide a clue as to why the later error occurs:
4:40:21  STDOUT:
14:40:21  STDERR:
14:40:21  TEST_CLASSES:
14:40:21  /home/jenkins/workspace/Grinder/openjdk-tests/TKG/output_1618494002301/jdk_custom_1/work/classes/0/com/sun/jndi/ldap
14:40:21  Testing: ldap:///dc=example,dc=com, localhost:389
14:40:21  javax.naming.CommunicationException: localhost:389 [Root exception is java.net.ConnectException: Connection refused (Connection refused)]
14:40:21  	at com.sun.jndi.ldap.Connection.<init>(Connection.java:243)
14:40:21  	at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137)
14:40:21  	at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1615)
14:40:21  	at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2849)
14:40:21  	at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:347)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:225)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:189)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:243)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
14:40:21  	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
14:40:21  	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
14:40:21  	at javax.naming.InitialContext.init(InitialContext.java:244)
14:40:21  	at javax.naming.InitialContext.<init>(InitialContext.java:216)
14:40:21  	at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101)
14:40:21  	at ProviderTest.call(LdapDnsProviderTest.java:108)
14:40:21  	at ProviderTest.call(LdapDnsProviderTest.java:78)
14:40:21  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
14:40:21  	at java.lang.Thread.run(Thread.java:821)
14:40:21  Caused by: java.net.ConnectException: Connection refused (Connection refused)
14:40:21  	at java.net.PlainSocketImpl.socketConnect(Native Method)
14:40:21  	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
14:40:21  	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
14:40:21  	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
14:40:21  	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
14:40:21  	at java.net.Socket.connect(Socket.java:607)
14:40:21  	at java.net.Socket.connect(Socket.java:556)
14:40:21  	at java.net.Socket.<init>(Socket.java:452)
14:40:21  	at java.net.Socket.<init>(Socket.java:229)
14:40:21  	at com.sun.jndi.ldap.Connection.createSocket(Connection.java:380)
14:40:21  	at com.sun.jndi.ldap.Connection.<init>(Connection.java:220)
14:40:21  	... 18 more
14:40:21  Test passed
14:40:21  Testing: ldap://localhost/dc=example,dc=com, localhost:389
14:40:21  javax.naming.CommunicationException: localhost:389 [Root exception is java.net.ConnectException: Connection refused (Connection refused)]
14:40:21  	at com.sun.jndi.ldap.Connection.<init>(Connection.java:243)
14:40:21  	at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137)
14:40:21  	at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1615)
14:40:21  	at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2849)
14:40:21  	at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:347)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:225)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:189)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:243)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
14:40:21  	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
14:40:21  	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
14:40:21  	at javax.naming.InitialContext.init(InitialContext.java:244)
14:40:21  	at javax.naming.InitialContext.<init>(InitialContext.java:216)
14:40:21  	at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101)
14:40:21  	at ProviderTest.call(LdapDnsProviderTest.java:108)
14:40:21  	at ProviderTest.call(LdapDnsProviderTest.java:78)
14:40:21  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
14:40:21  	at java.lang.Thread.run(Thread.java:821)
14:40:21  Caused by: java.net.ConnectException: Connection refused (Connection refused)
14:40:21  	at java.net.PlainSocketImpl.socketConnect(Native Method)
14:40:21  	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
14:40:21  	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
14:40:21  	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
14:40:21  	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
14:40:21  	at java.net.Socket.connect(Socket.java:607)
14:40:21  	at java.net.Socket.connect(Socket.java:556)
14:40:21  	at java.net.Socket.<init>(Socket.java:452)
14:40:21  	at java.net.Socket.<init>(Socket.java:229)
14:40:21  	at com.sun.jndi.ldap.Connection.createSocket(Connection.java:380)
14:40:21  	at com.sun.jndi.ldap.Connection.<init>(Connection.java:220)
14:40:21  	... 18 more
14:40:21  Test passed
14:40:21  Testing: ldap://localhost:111/dc=example,dc=com, localhost:111
14:40:21  javax.naming.NamingException: LDAP connection has been closed
14:40:21  	at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:133)
14:40:21  	at com.sun.jndi.ldap.Connection.readReply(Connection.java:469)
14:40:21  	at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:365)
14:40:21  	at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:192)
14:40:21  	at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2897)
14:40:21  	at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:347)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:225)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:189)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:243)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
14:40:21  	at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
14:40:21  	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
14:40:21  	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
14:40:21  	at javax.naming.InitialContext.init(InitialContext.java:244)
14:40:21  	at javax.naming.InitialContext.<init>(InitialContext.java:216)
14:40:21  	at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101)
14:40:21  	at ProviderTest.call(LdapDnsProviderTest.java:108)
14:40:21  	at ProviderTest.call(LdapDnsProviderTest.java:78)
14:40:21  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
14:40:21  	at java.lang.Thread.run(Thread.java:821)
14:40:21  Test failed
14:40:21  Test failed
14:40:21  java.lang.RuntimeException: Test failed, unexpected result
14:40:21  	at LdapDnsProviderTest.runTest(LdapDnsProviderTest.java:221)
14:40:21  	at LdapDnsProviderTest.main(LdapDnsProviderTest.java:196)
14:40:21  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:40:21  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
14:40:21  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
14:40:21  	at java.lang.reflect.Method.invoke(Method.java:498)
14:40:21  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
14:40:21  	at java.lang.Thread.run(Thread.java:821)
14:40:21  
14:40:21  JavaTest Message: Test threw exception: java.lang.RuntimeException: Test failed, unexpected result
14:40:21  JavaTest Message: shutting down test

@lumpfish
Copy link
Contributor

Also seen on s390x_linux, openj9 jdk8, test-marist-ubuntu1604-s390x-3, https://ci.adoptopenjdk.net/job/Test_openjdk8_j9_extended.openjdk_s390x_linux/22/consoleFull. Same connection refused message:

12:09:29  TEST: com/sun/jndi/ldap/LdapDnsProviderTest.java
12:09:29  TEST JDK: /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image
12:09:29  
12:09:29  ACTION: compile -- Passed. Compilation successful
12:09:29  REASON: User specified action: run compile dnsprovider/TestDnsProvider.java 
12:09:29  TIME:   0.602 seconds
12:09:29  messages:
12:09:29  command: compile /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap/dnsprovider/TestDnsProvider.java
12:09:29  reason: User specified action: run compile dnsprovider/TestDnsProvider.java 
12:09:29  Mode: agentvm
12:09:29  Agent id: 3
12:09:29  elapsed time (seconds): 0.602
12:09:29  configuration:
12:09:29  Boot Layer (javac runtime environment)
12:09:29    class path: /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image/lib/tools.jar
12:09:29                /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/jvmtest/openjdk/jtreg/lib/javatest.jar
12:09:29                /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/jvmtest/openjdk/jtreg/lib/jtreg.jar
12:09:29  
12:09:29  javac compilation environment
12:09:29    source path: /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap
12:09:29    class path:  /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap
12:09:29                 /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap
12:09:29                 /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image/lib/tools.jar
12:09:29  
12:09:29  rerun:
12:09:29  cd /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/scratch/0 && \
12:09:29  DISPLAY=:0 \
12:09:29  HOME=/home/jenkins \
12:09:29  LANG=en_US.UTF-8 \
12:09:29  PATH=/bin:/usr/bin:/usr/sbin \
12:09:29      /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image/bin/javac \
12:09:29          -J-ea \
12:09:29          -J-esa \
12:09:29          -J-Xmx512m \
12:09:29          -J-XX:+UseCompressedOops \
12:09:29          -J-Dtest.vm.opts='-ea -esa -Xmx512m -XX:+UseCompressedOops' \
12:09:29          -J-Dtest.tool.vm.opts='-J-ea -J-esa -J-Xmx512m -J-XX:+UseCompressedOops' \
12:09:29          -J-Dtest.compiler.opts= \
12:09:29          -J-Dtest.java.opts= \
12:09:29          -J-Dtest.jdk=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image \
12:09:29          -J-Dcompile.jdk=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image \
12:09:29          -J-Dtest.timeout.factor=8.0 \
12:09:29          -J-Dtest.root=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test \
12:09:29          -J-Dtest.name=com/sun/jndi/ldap/LdapDnsProviderTest.java \
12:09:29          -J-Dtest.file=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap/LdapDnsProviderTest.java \
12:09:29          -J-Dtest.src=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap \
12:09:29          -J-Dtest.src.path=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap \
12:09:29          -J-Dtest.classes=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap \
12:09:29          -J-Dtest.class.path=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap \
12:09:29          -J-Dtest.class.path.prefix=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap:/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap \
12:09:29          -d /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap \
12:09:29          -sourcepath /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap \
12:09:29          -classpath /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap:/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap:/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image/lib/tools.jar /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap/dnsprovider/TestDnsProvider.java
12:09:29  direct:
12:09:29  /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap/dnsprovider/TestDnsProvider.java:7: warning: LdapDnsProvider is internal proprietary API and may be removed in a future release
12:09:29  import com.sun.jndi.ldap.spi.LdapDnsProvider;
12:09:29                              ^
12:09:29  /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap/dnsprovider/TestDnsProvider.java:8: warning: LdapDnsProviderResult is internal proprietary API and may be removed in a future release
12:09:29  import com.sun.jndi.ldap.spi.LdapDnsProviderResult;
12:09:29                              ^
12:09:29  /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap/dnsprovider/TestDnsProvider.java:10: warning: LdapDnsProvider is internal proprietary API and may be removed in a future release
12:09:29  public class TestDnsProvider extends LdapDnsProvider {
12:09:29                                       ^
12:09:29  /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap/dnsprovider/TestDnsProvider.java:12: warning: LdapDnsProviderResult is internal proprietary API and may be removed in a future release
12:09:29      public Optional<LdapDnsProviderResult> lookupEndpoints(String url,
12:09:29                      ^
12:09:29  /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap/dnsprovider/TestDnsProvider.java:18: warning: LdapDnsProviderResult is internal proprietary API and may be removed in a future release
12:09:29                  new LdapDnsProviderResult("test.com", endpoints));
12:09:29                      ^
12:09:29  5 warnings
12:09:29  
12:09:29  ACTION: build -- Passed. Build successful
12:09:29  REASON: Named class compiled on demand
12:09:29  TIME:   0.164 seconds
12:09:29  messages:
12:09:29  command: build LdapDnsProviderTest
12:09:29  reason: Named class compiled on demand
12:09:29  Test directory:
12:09:29    compile: LdapDnsProviderTest
12:09:29  elapsed time (seconds): 0.164
12:09:29  
12:09:29  ACTION: compile -- Passed. Compilation successful
12:09:29  REASON: .class file out of date or does not exist
12:09:29  TIME:   0.164 seconds
12:09:29  messages:
12:09:29  command: compile -XDignore.symbol.file=true /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap/LdapDnsProviderTest.java
12:09:29  reason: .class file out of date or does not exist
12:09:29  Mode: agentvm
12:09:29  Agent id: 3
12:09:29  elapsed time (seconds): 0.164
12:09:29  configuration:
12:09:29  Boot Layer (javac runtime environment)
12:09:29    class path: /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image/lib/tools.jar
12:09:29                /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/jvmtest/openjdk/jtreg/lib/javatest.jar
12:09:29                /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/jvmtest/openjdk/jtreg/lib/jtreg.jar
12:09:29  
12:09:29  javac compilation environment
12:09:29    source path: /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap
12:09:29    class path:  /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap
12:09:29                 /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap
12:09:29                 /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image/lib/tools.jar
12:09:29  
12:09:29  rerun:
12:09:29  cd /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/scratch/0 && \
12:09:29  DISPLAY=:0 \
12:09:29  HOME=/home/jenkins \
12:09:29  LANG=en_US.UTF-8 \
12:09:29  PATH=/bin:/usr/bin:/usr/sbin \
12:09:29      /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image/bin/javac \
12:09:29          -J-ea \
12:09:29          -J-esa \
12:09:29          -J-Xmx512m \
12:09:29          -J-XX:+UseCompressedOops \
12:09:29          -J-Dtest.vm.opts='-ea -esa -Xmx512m -XX:+UseCompressedOops' \
12:09:29          -J-Dtest.tool.vm.opts='-J-ea -J-esa -J-Xmx512m -J-XX:+UseCompressedOops' \
12:09:29          -J-Dtest.compiler.opts= \
12:09:29          -J-Dtest.java.opts= \
12:09:29          -J-Dtest.jdk=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image \
12:09:29          -J-Dcompile.jdk=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image \
12:09:29          -J-Dtest.timeout.factor=8.0 \
12:09:29          -J-Dtest.root=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test \
12:09:29          -J-Dtest.name=com/sun/jndi/ldap/LdapDnsProviderTest.java \
12:09:29          -J-Dtest.file=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap/LdapDnsProviderTest.java \
12:09:29          -J-Dtest.src=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap \
12:09:29          -J-Dtest.src.path=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap \
12:09:29          -J-Dtest.classes=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap \
12:09:29          -J-Dtest.class.path=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap \
12:09:29          -J-Dtest.class.path.prefix=/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap:/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap \
12:09:29          -d /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap \
12:09:29          -sourcepath /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap \
12:09:29          -classpath /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap:/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap:/home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdkbinary/j2sdk-image/lib/tools.jar \
12:09:29          -XDignore.symbol.file=true /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/openjdk/openjdk-jdk/jdk/test/com/sun/jndi/ldap/LdapDnsProviderTest.java
12:09:29  
12:09:29  ACTION: main -- Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Test failed, unexpected result
12:09:29  REASON: User specified action: run main/othervm LdapDnsProviderTest 
12:09:29  TIME:   0.126 seconds
12:09:29  messages:
12:09:29  command: main LdapDnsProviderTest
12:09:29  reason: User specified action: run main/othervm LdapDnsProviderTest 
12:09:29  Mode: othervm [/othervm specified]
12:09:29  elapsed time (seconds): 0.126
12:09:29  configuration:
12:09:29  STDOUT:
12:09:29  STDERR:
12:09:29  TEST_CLASSES:
12:09:29  /home/jenkins/workspace/Test_openjdk8_j9_extended.openjdk_s390x_linux/openjdk-tests/TKG/output_16190031767041/jdk_other_0/work/classes/1/com/sun/jndi/ldap
12:09:29  Testing: ldap:///dc=example,dc=com, localhost:389
12:09:29  javax.naming.CommunicationException: localhost:389 [Root exception is java.net.ConnectException: Connection refused (Connection refused)]
12:09:29  	at com.sun.jndi.ldap.Connection.<init>(Connection.java:243)
12:09:29  	at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137)
12:09:29  	at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1615)
12:09:29  	at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2849)
12:09:29  	at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:347)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:225)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:189)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:243)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
12:09:29  	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:695)
12:09:29  	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
12:09:29  	at javax.naming.InitialContext.init(InitialContext.java:244)
12:09:29  	at javax.naming.InitialContext.<init>(InitialContext.java:216)
12:09:29  	at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101)
12:09:29  	at ProviderTest.call(LdapDnsProviderTest.java:108)
12:09:29  	at ProviderTest.call(LdapDnsProviderTest.java:78)
12:09:29  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
12:09:29  	at java.lang.Thread.run(Thread.java:823)
12:09:29  Caused by: java.net.ConnectException: Connection refused (Connection refused)
12:09:29  	at java.net.PlainSocketImpl.socketConnect(Native Method)
12:09:29  	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
12:09:29  	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
12:09:29  	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
12:09:29  	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
12:09:29  	at java.net.Socket.connect(Socket.java:607)
12:09:29  	at java.net.Socket.connect(Socket.java:556)
12:09:29  	at java.net.Socket.<init>(Socket.java:452)
12:09:29  	at java.net.Socket.<init>(Socket.java:229)
12:09:29  	at com.sun.jndi.ldap.Connection.createSocket(Connection.java:380)
12:09:29  	at com.sun.jndi.ldap.Connection.<init>(Connection.java:220)
12:09:29  	... 18 more
12:09:29  Test passed
12:09:29  Testing: ldap://localhost/dc=example,dc=com, localhost:389
12:09:29  javax.naming.CommunicationException: localhost:389 [Root exception is java.net.ConnectException: Connection refused (Connection refused)]
12:09:29  	at com.sun.jndi.ldap.Connection.<init>(Connection.java:243)
12:09:29  	at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137)
12:09:29  	at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1615)
12:09:29  	at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2849)
12:09:29  	at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:347)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:225)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:189)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:243)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
12:09:29  	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:695)
12:09:29  	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
12:09:29  	at javax.naming.InitialContext.init(InitialContext.java:244)
12:09:29  	at javax.naming.InitialContext.<init>(InitialContext.java:216)
12:09:29  	at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101)
12:09:29  	at ProviderTest.call(LdapDnsProviderTest.java:108)
12:09:29  	at ProviderTest.call(LdapDnsProviderTest.java:78)
12:09:29  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
12:09:29  	at java.lang.Thread.run(Thread.java:823)
12:09:29  Caused by: java.net.ConnectException: Connection refused (Connection refused)
12:09:29  	at java.net.PlainSocketImpl.socketConnect(Native Method)
12:09:29  	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
12:09:29  	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
12:09:29  	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
12:09:29  	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
12:09:29  	at java.net.Socket.connect(Socket.java:607)
12:09:29  	at java.net.Socket.connect(Socket.java:556)
12:09:29  	at java.net.Socket.<init>(Socket.java:452)
12:09:29  	at java.net.Socket.<init>(Socket.java:229)
12:09:29  	at com.sun.jndi.ldap.Connection.createSocket(Connection.java:380)
12:09:29  	at com.sun.jndi.ldap.Connection.<init>(Connection.java:220)
12:09:29  	... 18 more
12:09:29  Test passed
12:09:29  Testing: ldap://localhost:111/dc=example,dc=com, localhost:111
12:09:29  javax.naming.NamingException: LDAP connection has been closed
12:09:29  	at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:133)
12:09:29  	at com.sun.jndi.ldap.Connection.readReply(Connection.java:469)
12:09:29  	at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:365)
12:09:29  	at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:192)
12:09:29  	at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2897)
12:09:29  	at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:347)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:225)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:189)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:243)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
12:09:29  	at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
12:09:29  	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:695)
12:09:29  	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
12:09:29  	at javax.naming.InitialContext.init(InitialContext.java:244)
12:09:29  	at javax.naming.InitialContext.<init>(InitialContext.java:216)
12:09:29  	at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101)
12:09:29  	at ProviderTest.call(LdapDnsProviderTest.java:108)
12:09:29  	at ProviderTest.call(LdapDnsProviderTest.java:78)
12:09:29  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
12:09:29  	at java.lang.Thread.run(Thread.java:823)
12:09:29  Test failed
12:09:29  Test failed
12:09:29  java.lang.RuntimeException: Test failed, unexpected result
12:09:29  	at LdapDnsProviderTest.runTest(LdapDnsProviderTest.java:221)
12:09:29  	at LdapDnsProviderTest.main(LdapDnsProviderTest.java:196)
12:09:29  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:09:29  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:09:29  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:09:29  	at java.lang.reflect.Method.invoke(Method.java:498)
12:09:29  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
12:09:29  	at java.lang.Thread.run(Thread.java:823)
12:09:29  
12:09:29  JavaTest Message: Test threw exception: java.lang.RuntimeException: Test failed, unexpected result
12:09:29  JavaTest Message: shutting down test

@Haroon-Khel
Copy link
Contributor

Able to recreate this locally on test-marist-ubuntu1604-s390x-3

@sxa
Copy link
Member

sxa commented Apr 28, 2021

Note that test-marist-ubuntu1604-s390x-3 is now [test-marist-ubuntu1804-s390x-1](https://ci.adoptopenjdk.net/computer/test-marist-ubuntu1804-s390x-1/ after an OS upgrade) as per adoptium/infrastructure#2156 so it may be worth seeing if it still occurs on there or whether the upgrade has had an impact.

@lumpfish
Copy link
Contributor

lumpfish commented Apr 28, 2021

Looking at the test case code (https://github.com/AdoptOpenJDK/openjdk-jdk8u/blob/master/jdk/test/com/sun/jndi/ldap/LdapDnsProviderTest.java), the Connection refused exceptions are expected. The failing subtest is the javax.naming.NamingException (which still occurs on test-marist-ubuntu1804-s390x-1):

01:48:22  Testing: ldap://localhost:111/dc=example,dc=com, localhost:111
01:48:22  javax.naming.NamingException: LDAP connection has been closed
01:48:22  	at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:133)
01:48:22  	at com.sun.jndi.ldap.Connection.readReply(Connection.java:469)
01:48:22  	at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:365)
01:48:22  	at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:192)
01:48:22  	at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2897)
01:48:22  	at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:347)
01:48:22  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:225)
01:48:22  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:189)
01:48:22  	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:243)
01:48:22  	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
01:48:22  	at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
01:48:22  	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
01:48:22  	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
01:48:22  	at javax.naming.InitialContext.init(InitialContext.java:244)
01:48:22  	at javax.naming.InitialContext.<init>(InitialContext.java:216)
01:48:22  	at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101)
01:48:22  	at ProviderTest.call(LdapDnsProviderTest.java:108)
01:48:22  	at ProviderTest.call(LdapDnsProviderTest.java:78)
01:48:22  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
01:48:22  	at java.lang.Thread.run(Thread.java:823)
01:48:22  Test failed

The test is expecting 'Connection refused' for this subtest also. This is the output from a test run which passes:

Testing: ldap://localhost:111/dc=example,dc=com, localhost:111
javax.naming.CommunicationException: localhost:111 [Root exception is java.net.ConnectException: Connection refused (Connection refused)]
	at com.sun.jndi.ldap.Connection.<init>(Connection.java:243)
	at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137)
	at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1615)
	at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2849)
	at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:347)
	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:225)
	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:189)
	at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:243)
	at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
	at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:695)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
	at javax.naming.InitialContext.init(InitialContext.java:244)
	at javax.naming.InitialContext.<init>(InitialContext.java:216)
	at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101)
	at ProviderTest.call(LdapDnsProviderTest.java:108)
	at ProviderTest.call(LdapDnsProviderTest.java:78)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.lang.Thread.run(Thread.java:823)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:607)
	at java.net.Socket.connect(Socket.java:556)
	at java.net.Socket.<init>(Socket.java:452)
	at java.net.Socket.<init>(Socket.java:229)
	at com.sun.jndi.ldap.Connection.createSocket(Connection.java:380)
	at com.sun.jndi.ldap.Connection.<init>(Connection.java:220)
	... 18 more
Test passed

The stack traces show the test is following different paths through the jdk code in the passing and failing cases.

@Haroon-Khel
Copy link
Contributor

Haroon-Khel commented Apr 28, 2021

The failing test lines of code are found here https://github.com/ibmruntimes/openj9-openjdk-jdk8/blob/2c626feefcf485843cd2451597dc04eb41b1887f/jdk/test/com/sun/jndi/ldap/LdapDnsProviderTest.java#L194

From the error log, only the 3 ldap tests are run and not the ldaps tests. (Unless im looking in the wrong test file)

@lumpfish
Copy link
Contributor

lumpfish commented Apr 29, 2021

Only three tests are run in the failing case because the test stops on first failure.
The difference between a failing and passing test run is that for the Testing: ldap://localhost:111/dc=example,dc=com, localhost:111 input the com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2849) call fails when the test passes, but succeeds when the test fails. In the failing case further code is then executed which throws the

01:48:22  javax.naming.NamingException: LDAP connection has been closed
01:48:22  	at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:133)

exception later.

The test expects an exception to be thrown and for the exception message text to contain the second argument in the test input (localhost:111 in ldap://localhost:111/dc=example,dc=com, localhost:111). In the case of a 'Connection refused' exception localhost:111 is seen, but the test does not explicitly say that exception is the expected result.

So the question appears to be - why does the connect to ldap://localhost:111 fail when the test passes and succeed when the test fails?

Still looking......

@sxa
Copy link
Member

sxa commented Apr 29, 2021

Looks like rpcbind is listening on port 111 which would result it in managing to get a connection when it is expecting connection refused:

root@test-marist-ubuntu1804-s390x-1:~# netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      757/rpcbind         
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      950/systemd-resolve 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1232/sshd           
tcp6       0      0 :::111                  :::*                    LISTEN      757/rpcbind         
tcp6       0      0 :::22                   :::*                    LISTEN      1232/sshd           
udp        0      0 127.0.0.53:53           0.0.0.0:*                           950/systemd-resolve 
udp        0      0 0.0.0.0:68              0.0.0.0:*                           982/dhclient        
udp        0      0 0.0.0.0:111             0.0.0.0:*                           757/rpcbind         
udp        0      0 148.100.113.30:123      0.0.0.0:*                           1174/ntpd           
udp        0      0 127.0.0.1:123           0.0.0.0:*                           1174/ntpd           
udp        0      0 0.0.0.0:123             0.0.0.0:*                           1174/ntpd           
udp        0      0 0.0.0.0:933             0.0.0.0:*                           757/rpcbind         
udp6       0      0 :::111                  :::*                                757/rpcbind         
udp6       0      0 2620:91:0:656:f816::123 :::*                                1174/ntpd           
udp6       0      0 fe80::f816:3eff:fe5:123 :::*                                1174/ntpd           
udp6       0      0 ::1:123                 :::*                                1174/ntpd           
udp6       0      0 :::123                  :::*                                1174/ntpd           
udp6       0      0 :::933                  :::*                                757/rpcbind         

I've shut down the rpcbind service on test-marist-ubuntu1804-s390x-1 so we can try on there to determine if that has resolved in, then we can decide on the appropriate course of action going forward.

@lumpfish
Copy link
Contributor

The test passes on test-marist-ubuntu1804-s390x-1 now that the rpcbind service has been stopped: https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/446/console.

If 111 is a port used by a standard service and the test expects it to be not in use, then the test using a different port would appear to be the best 'fix'.

@lumpfish
Copy link
Contributor

The jdk11 version of the test uses port 1111 rather than port 111: https://github.com/AdoptOpenJDK/openjdk-jdk11u/blob/master/test/jdk/com/sun/jndi/ldap/LdapDnsProviderTest.java, so that is why the failure is only seen on jdk8.

@lumpfish
Copy link
Contributor

lumpfish commented May 4, 2021

Fork/branch https://github.com/lumpfish/openjdk-jdk8u/tree/fix_LdapDnsProviderTest has the change, test now passes: https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/500/console

This fix should ideally be contributed upstream to openjdk.

@lumpfish
Copy link
Contributor

Test has been excluded for this failure and also for impacting test com/sun/jndi/ldap/LdapTimeoutTest.java: see #2355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

5 participants