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

Jetty 10 based JenkinsRule #453

Merged
merged 5 commits into from Dec 7, 2022
Merged

Jetty 10 based JenkinsRule #453

merged 5 commits into from Dec 7, 2022

Conversation

basil
Copy link
Member

@basil basil commented Jul 5, 2022

Now that the test harness requires Java 11, we can move to a Jetty 10 baed JenkinsRule. To test this I ran the Swarm plugin tests as well as a subset of core tests with this PR. I also verified that this PR, once widely adopted, will allow us to remove Jetty 9 support from core.

@@ -543,6 +546,7 @@ protected ServletContext createWebServer() throws Exception {
context.setConfigurations(new Configuration[]{new WebXmlConfiguration()});
context.addBean(new NoListenerConfiguration(context));
server.setHandler(context);
JettyWebSocketServletContainerInitializer.configure(context, null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jglick jglick mentioned this pull request Dec 2, 2022
@basil basil marked this pull request as ready for review December 7, 2022 15:20
@basil
Copy link
Member Author

basil commented Dec 7, 2022

Still need to move hpi:run to Jetty 10 but I see no reason not to get the ball rolling on this in the meantime.

@basil basil merged commit 0cdf154 into jenkinsci:master Dec 7, 2022
@basil basil deleted the jetty10 branch December 7, 2022 15:24
@@ -796,6 +799,7 @@ public static ImmutablePair<Server, ServletContext> _createWebServer(String cont
context.setConfigurations(new Configuration[]{new WebXmlConfiguration()});
context.addBean(new NoListenerConfiguration(context));
server.setHandler(context);
JettyWebSocketServletContainerInitializer.configure(context, null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@basil FYI this JTH release breaks a WebSocket test in the kubernetes plugin:

java.lang.NullPointerException: Cannot invoke "org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer.upgrade(org.eclipse.jetty.websocket.server.JettyWebSocketCreator, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)" because the return value of "org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer.getContainer(javax.servlet.ServletContext)" is null
	at jenkins.websocket.Jetty10Provider.handle(Jetty10Provider.java:61)
	at jenkins.websocket.WebSockets.lambda$upgrade$0(WebSockets.java:70)

I am still trying to understand why; in the meantime, jenkinsci/kubernetes-plugin@dcc8137

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, never mind, I think this is due to a stale copy in that plugin (#289 (comment)).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to hear it, especially given that I tested this case by running the Swarm plugin's JenkinsRule-based tests (which use WebSocket) against this PR prior to its merge and release.

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

Successfully merging this pull request may close these issues.

None yet

2 participants