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

flaky test KeystoreScannerTest.testKeystoreRemoval() #5062

Closed
lachlan-roberts opened this issue Jul 20, 2020 · 1 comment · Fixed by #5065
Closed

flaky test KeystoreScannerTest.testKeystoreRemoval() #5062

lachlan-roberts opened this issue Jul 20, 2020 · 1 comment · Fixed by #5065

Comments

@lachlan-roberts
Copy link
Contributor

Test failure KeystoreScannerTest.testKeystoreRemoval() after merging PR #5042

2020-07-20 23:28:46.020:INFO :oejs.Server:main: jetty-10.0.0-SNAPSHOT; built: unknown; git: ; jvm 11.0.5+10-LTS
2020-07-20 23:28:46.023:INFO :oejus.SslContextFactory:main: x509=X509@3148f668(jetty,h=[jetty.eclipse.org],w=[]) for Server@6e005dc9[provider=null,keyStore=file:///home/lachlan/webtide/src/jetty-10.0.x/tests/test-integration/target/tests/oejt.KeyStoreScannerTest/testKeystoreRemoval/keystore,trustStore=null]
2020-07-20 23:28:46.026:INFO :oejs.AbstractConnector:main: Started ServerConnector@573906eb{SSL, (ssl, http/1.1)}{0.0.0.0:38515}
2020-07-20 23:28:46.027:INFO :oejs.Server:main: Started Server@571c5681{STARTING}[10.0.0-SNAPSHOT,sto=0] @16371ms
2020-07-20 23:28:48.043:WARN :oejus.KeyStoreScanner:Scanner-6: Keystore Reload Failed: java.lang.IllegalStateException: /home/lachlan/webtide/src/jetty-10.0.x/tests/test-integration/target/tests/oejt.KeyStoreScannerTest/testKeystoreRemoval/keystore is not a valid keystore
2020-07-20 23:28:48.054:WARN :oeji.ManagedSelector:qtp541285440-90: Could not accept java.nio.channels.SocketChannel[closed]: java.lang.IllegalStateException: SslContextFactory reload failed
2020-07-20 23:28:50.060:WARN :oeji.ManagedSelector:qtp541285440-86: Could not accept java.nio.channels.SocketChannel[closed]: java.lang.IllegalStateException: SslContextFactory reload failed
2020-07-20 23:28:50.064:INFO :oejus.SslContextFactory:Scanner-6: x509=X509@739341f3(jetty-test-keystore,h=[],w=[]) for Server@6e005dc9[provider=null,keyStore=file:///home/lachlan/webtide/src/jetty-10.0.x/tests/test-integration/target/tests/oejt.KeyStoreScannerTest/testKeystoreRemoval/keystore,trustStore=null]
2020-07-20 23:28:50.067:INFO :oejs.Server:main: Stopped Server@571c5681{STOPPING}[10.0.0-SNAPSHOT,sto=0]
2020-07-20 23:28:50.068:INFO :oejs.AbstractConnector:main: Stopped ServerConnector@573906eb{SSL, (ssl, http/1.1)}{0.0.0.0:0}

javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake

	at java.base/sun.security.ssl.SSLSocketImpl.handleEOF(SSLSocketImpl.java:1321)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1160)
	at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402)
	at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:567)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:168)
	at org.eclipse.jetty.test.KeyStoreScannerTest.getCertificateFromServer(KeyStoreScannerTest.java:264)
	at org.eclipse.jetty.test.KeyStoreScannerTest.testKeystoreRemoval(KeyStoreScannerTest.java:175)
        ...
Caused by: java.io.EOFException: SSL peer shut down incorrectly
	at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:167)
	at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:108)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152)
@lachlan-roberts lachlan-roberts self-assigned this Jul 20, 2020
@gregw
Copy link
Contributor

gregw commented Jul 20, 2020

I expect that it is a timing thing. To test the scanner you normally end up needing to explicitly call Scanner.scan() or using the scan listener, so the test knows when a scan has been completed

Note also that testReloadWithBadKeystore prints out a stack trace when it still succeeds

lachlan-roberts added a commit that referenced this issue Jul 21, 2020
… timing issues

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jul 21, 2020
… timing issues

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jul 23, 2020
…moval

Issue #5062 - fix flaky test KeyStoreScannerTest.testKeystoreRemoval()
@joakime joakime added the Test label Jul 23, 2020
@joakime joakime added this to To Do in Jetty 10.0.0 via automation Jul 23, 2020
@joakime joakime added this to To do in Jetty 9.4.31 via automation Jul 23, 2020
@joakime joakime moved this from To do to Done in Jetty 9.4.31 Jul 23, 2020
@joakime joakime moved this from To Do to Done in Jetty 10.0.0 Jul 23, 2020
leonchen83 pushed a commit to leonchen83/jetty.project that referenced this issue Aug 3, 2020
…avoid timing issues

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Jetty 10.0.0
  
Done
Jetty 9.4.31
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants