helidon icon indicating copy to clipboard operation
helidon copied to clipboard

Intermittent flaky test: UrlOverrideSourceServerMockTest

Open ljnelson opened this issue 2 years ago • 1 comments

I cannot get a clean run in helidon-config on master because UrlOverrideSourceServerMockTest keeps failing. Some representative stack snippets:

[ERROR] io.helidon.config.UrlOverrideSourceServerMockTest.testMultipleMatchingWildcards  Time elapsed: 90.112 s  <<< ERROR!
io.helidon.config.ConfigException: Configuration at url 'http://127.0.0.1:46548/override' GET is not accessible.
	at io.helidon.config.UrlOverrideSource.load(UrlOverrideSource.java:132)
[...]
Caused by: java.net.SocketException: Connection reset by peer
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Net.java:579)
	at java.base/sun.nio.ch.Net.connect(Net.java:568)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
	at java.base/java.net.Socket.connect(Socket.java:633)
	at java.base/java.net.Socket.connect(Socket.java:583)
	at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:498)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
	at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:246)
	at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:351)
	at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:373)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
	at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529)
	at io.helidon.config.UrlOverrideSource.load(UrlOverrideSource.java:109)

And:

[ERROR] io.helidon.config.UrlOverrideSourceServerMockTest.testConfigChangingWithOverrideSource  Time elapsed: 16.88 s  <<< FAILURE!
java.lang.AssertionError: 

Expected: is <Optional.empty>
     but: was <Optional[URL1]>
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
	at io.helidon.config.ConfigTest.waitForAssert(ConfigTest.java:837)
	at io.helidon.config.ConfigTest.waitForAssert(ConfigTest.java:822)
	at io.helidon.config.UrlOverrideSourceServerMockTest.testConfigChangingWithOverrideSource(UrlOverrideSourceServerMockTest.java:308)

I have an M1-based Mac in case it matters. Nothing else odd.

ljnelson avatar Jun 27 '22 19:06 ljnelson

Couldn't reproduce on Ryzen-based Linux

danielkec avatar Jun 30 '22 17:06 danielkec

+1 with an Intel Mac with Ventura 13.2.1 and Java 20

Update. Every run was failing at this test, even when I dropped back to Java 19. I then happened to update Ventura and rebooted and the test passed from then on.

tjquinno avatar Mar 31 '23 20:03 tjquinno