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

Try JDK 19 #1637

Closed
wants to merge 1 commit into from
Closed

Try JDK 19 #1637

wants to merge 1 commit into from

Conversation

basil
Copy link
Member

@basil basil commented Dec 10, 2022

No description provided.

@basil
Copy link
Member Author

basil commented Dec 10, 2022

Only 4 test failures, better than I was expecting. The three from display-url-api are all false positives caused by an outdated build toolchain, fixed in jenkinsci/display-url-api-plugin#159.

@basil
Copy link
Member Author

basil commented Dec 10, 2022

The hudson.plugins.git.browser.AssemblaWebDoCheckURLTest#testInitialChecksOnRepoUrl is interesting and can be reproduced easily on Java 19. It starts happening after openjdk/jdk#7181 and can be reproduced even on Java 11 by adding

diff --git a/core/src/main/java/hudson/util/FormValidation.java b/core/src/main/java/hudson/util/FormValidation.java
index 931e47ccf0..e733a77c73 100644
--- a/core/src/main/java/hudson/util/FormValidation.java
+++ b/core/src/main/java/hudson/util/FormValidation.java
@@ -471,6 +471,7 @@ public abstract class FormValidation extends IOException implements HttpResponse
             if (con == null) { // TODO is this even permitted by URL.openConnection?
                 throw new IOException(url.toExternalForm());
             }
+            con.setRequestProperty("Accept", "*/*");
             return new BufferedReader(
                 new InputStreamReader(con.getInputStream(), getCharset(con)));
         }

This should be fine but for whatever reason an accept header of */* rather than text/html causes the server to start spitting out a 404 instead of a 200. This can even be seen with curl(1):

$ curl --head --header "Accept: text/html" https://app.assembla.com/login
HTTP/2 200 
[…]
$
$ curl --head --header "Accept: */*" https://app.assembla.com/login
HTTP/2 404 
[…]

This is hardly our fault and I do not think there is anything the Jenkins code should be doing differently here. If anything I would just exclude this test.

@basil
Copy link
Member Author

basil commented Dec 10, 2022

For whatever reason the above error goes away when using the native Java 11 HTTP client as in jenkinsci/jenkins#7508.

@basil
Copy link
Member Author

basil commented Dec 10, 2022

I have learned everything I want to learn from this exercise.

@basil basil closed this Dec 10, 2022
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.

None yet

1 participant