-
Couldn't load subscription status.
- Fork 2k
Issue #13525 - potential fix for flakiness in JakartaWebSocketFrameHandlerOnMessageBinaryStreamTest #13550
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
base: jetty-12.1.x
Are you sure you want to change the base?
Issue #13525 - potential fix for flakiness in JakartaWebSocketFrameHandlerOnMessageBinaryStreamTest #13550
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,15 +29,15 @@ | |
| public abstract class AbstractJakartaWebSocketFrameHandlerTest | ||
| { | ||
| protected DummyContainer container; | ||
| private WebSocketComponents components; | ||
| protected WebSocketComponents components; | ||
|
|
||
| @BeforeEach | ||
| public void startContainer() throws Exception | ||
| { | ||
| container = new DummyContainer(); | ||
| container.start(); | ||
| components = new WebSocketComponents(); | ||
| container = new DummyContainer(components); | ||
| components.start(); | ||
| container.start(); | ||
|
|
||
| endpointConfig = ClientEndpointConfig.Builder.create().build(); | ||
| encoders = new AvailableEncoders(endpointConfig, coreSession.getWebSocketComponents()); | ||
|
|
@@ -48,8 +48,8 @@ public void startContainer() throws Exception | |
| @AfterEach | ||
| public void stopContainer() | ||
| { | ||
| LifeCycle.stop(components); | ||
| LifeCycle.stop(container); | ||
| LifeCycle.stop(components); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just stop the container |
||
| } | ||
|
|
||
| protected AvailableEncoders encoders; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,6 @@ | |
| import jakarta.websocket.DeploymentException; | ||
| import jakarta.websocket.Endpoint; | ||
| import jakarta.websocket.Session; | ||
| import org.eclipse.jetty.util.thread.QueuedThreadPool; | ||
| import org.eclipse.jetty.websocket.core.WebSocketComponents; | ||
| import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry; | ||
|
|
||
|
|
@@ -31,15 +30,11 @@ | |
| public class DummyContainer extends JakartaWebSocketContainer | ||
| { | ||
| private final JakartaWebSocketFrameHandlerFactory frameHandlerFactory; | ||
| private final QueuedThreadPool executor; | ||
|
|
||
| public DummyContainer() | ||
| public DummyContainer(WebSocketComponents components) | ||
| { | ||
| super(new WebSocketComponents()); | ||
| super(components); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The super constructor should installBean(components), but it does not |
||
| this.frameHandlerFactory = new DummyFrameHandlerFactory(this); | ||
| this.executor = new QueuedThreadPool(); | ||
| this.executor.setName("qtp-DummyContainer"); | ||
| addBean(this.executor, true); | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -113,7 +108,7 @@ public void setDefaultMaxTextMessageBufferSize(int max) | |
| @Override | ||
| public Executor getExecutor() | ||
| { | ||
| return executor; | ||
| return getWebSocketComponents().getExecutor(); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,15 +30,15 @@ | |
| public abstract class AbstractJakartaWebSocketFrameHandlerTest | ||
| { | ||
| protected DummyContainer container; | ||
| private WebSocketComponents components; | ||
| protected WebSocketComponents components; | ||
|
|
||
| @BeforeEach | ||
| public void startContainer() throws Exception | ||
| { | ||
| container = new DummyContainer(); | ||
| container.start(); | ||
| components = new WebSocketComponents(); | ||
| container = new DummyContainer(components); | ||
| components.start(); | ||
| container.start(); | ||
|
Comment on lines
+39
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
|
||
| endpointConfig = ClientEndpointConfig.Builder.create().build(); | ||
| encoders = new AvailableEncoders(endpointConfig, coreSession.getWebSocketComponents()); | ||
|
|
@@ -49,8 +49,8 @@ public void startContainer() throws Exception | |
| @AfterEach | ||
| public void stopContainer() | ||
| { | ||
| LifeCycle.stop(components); | ||
| LifeCycle.stop(container); | ||
| LifeCycle.stop(components); | ||
| } | ||
|
|
||
| protected AvailableEncoders encoders; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting both should not be required. Just start the container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to do this.
Because in the non-test usage we have the
WebSocketComponentsmanaged by the server lifecycle so it can be shared between multiple WebSocket containers. For example if both Jakarta and Jetty websocket containers were used, or WebSocketContainers with different EE versions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jetty's component mechanism can handle this. If the components are managed by the server, then it will be started by server and the auto beans in the containers will be unmanaged.
Embrace the pattern!