Skip to content

Conversation

@offa
Copy link
Contributor

@offa offa commented Sep 22, 2025

Adds Java 25 CI builds.

There's a test error though (Java 25 on Linux only):

Error:  org.jsoup.integration.ProxyTest.canAuthenticateToProxy(String)[2] -- Time elapsed: 0.024 s <<< FAILURE!
org.opentest4j.AssertionFailedError: Expected 407 Proxy Authentication Required, got: Cannot invoke "jdk.internal.net.http.ExchangeImpl.cancel(java.io.IOException)" because "exch.exchImpl" is null
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:38)
	at org.junit.jupiter.api.Assertions.fail(Assertions.java:138)
	at org.jsoup.integration.ProxyTest.assertAuthRequiredException(ProxyTest.java:149)
	at org.jsoup.integration.ProxyTest.canAuthenticateToProxy(ProxyTest.java:129)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
[…]

@offa offa marked this pull request as draft September 22, 2025 17:12
@offa
Copy link
Contributor Author

offa commented Sep 22, 2025

All three are using Azul Java 25, but only one fails 🤔.

@jhy
Copy link
Owner

jhy commented Sep 23, 2025

Deeper stack is:

Caused by: java.lang.NullPointerException: Cannot invoke "jdk.internal.net.http.ExchangeImpl.cancel(java.io.IOException)" because "exch.exchImpl" is null
	at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsyncImpl$0(MultiExchange.java:446)
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1171)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:531)
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2206)
	at java.net.http/jdk.internal.net.http.ResponseSubscribers.lambda$getBodyAsync$1(ResponseSubscribers.java:1090)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:884)
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:862)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:531)
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2206)

Looking at jdk.internal.net.http.Exchange, I see that exchangeImpl is volatile and the code has various mentions of possible races when cancelling the request, and a lot of null guards, but not around where this fires. So far as I can see, jsoup is calling correctly; and it just happens that on this platform something is racing slower/faster than others and not producing the correct error.

I will try just having a specific catch for that string. Really the tests are just making sure that the proxy is actually checking authentication; as long as we get an exception on the incorrect password, and a pass on the correct, the test logic should be satisfied.

@jhy jhy marked this pull request as ready for review September 23, 2025 01:17
@jhy jhy merged commit 62d042a into jhy:master Sep 23, 2025
15 checks passed
@jhy
Copy link
Owner

jhy commented Sep 23, 2025

Thanks @offa, merged.

I think we can run with the four versions for a few weeks and then probably will remove 21.

@offa
Copy link
Contributor Author

offa commented Sep 23, 2025

Thanks for fixing the exception!

@jhy
Copy link
Owner

jhy commented Oct 2, 2025

(I've removed 21 in eeae0ff)

@offa offa deleted the java25 branch October 2, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants