-
Notifications
You must be signed in to change notification settings - Fork 112
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
Update TCK for changes in WebSocket 2.1 #783
Conversation
541b688
to
9d15c8a
Compare
This PR is now at the point where a WebSocket 2.1 compliant container should pass all tests. |
6305ff1
to
d297a4b
Compare
Force push was just a rebase to keep things in sync |
…Socket 2.1 This exclusion can, therefore, be removed
See websocket/235
865cdcc
to
6ceffa0
Compare
Rebased and added commit to download the new WebSocket client JAR |
ServerContainer sc = (ServerContainer) getServletContext().getAttribute("jakarta.websocket.server.ServerContainer"); | ||
ServerEndpointConfig sec = ServerEndpointConfig.Builder.create(WSTestServer.class, "/TCKTestServer").build(); | ||
try { | ||
sc.upgradeHttpToWebSocket(req, resp, sec, Collections.emptyMap()); |
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.
The tests under spec
folder usually check the assertions required by the Spec document (pdf). This test seems to check this new API method. Should it be in the ee
test folder then?
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.
Just for quick reference, the websocket test folder contains subfolders::
- api
- common
- ee
- negdep
- platform
- spec
I'm not sure about the purpose of the spec
folder myself versus ee
but typically, I thought ee
is for the Jakarta EE Full Platform
+ Web Profile
specific tests.
@LanceAndersen do you know the answer to Jan's question in the comment above?
Having a README.me file in the websocket folder that mentions what each folder is for could be helpful.
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.
It depends on the TCK. Some TCK uses ee for end-to-end tests (WebSocket+JAX-RS), some use ee for enterprise tests (I think JAX-WS, JPA) as opposed to SE tests. Platform folder contains tests for which a full platform is required, for instance for interoperability with CDI, i.e. tests that are only full CTS tests, and are not part of the standalone TCKs.
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.
It depends on the TCK. Some TCK uses ee for end-to-end tests (WebSocket+JAX-RS), some use ee for enterprise tests (I think JAX-WS, JPA) as opposed to SE tests. Platform folder contains tests for which a full platform is required, for instance for interoperability with CDI, i.e. tests that are only full CTS tests, and are not part of the standalone TCKs.
Thanks @jansupol, I had no idea of ^. If there are rules about which folders can include different types of tests, those rules should be documented somewhere, otherwise the pull request reviewers and contributors will have no idea (like me :-).
Personally, I don't yet fully understand the purpose of each of the above mentioned folders. Perhaps api
should instead be called javadoc
(it seems to only have assertions for javadoc). In the ee
(end-to-end) folder, I see both javadoc
+ spec
tests (same in other folders as well).
This PR is now blocking the Platform TCK from building (we are getting build failures) which means we cannot run Platform TCK testing to see where we are. IMO, this needs to be solved so that EE 10 Platform implementations can test if they want to.
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 assume you mean you need to merge this PR to fix the platform TCK build. If that is the case I'd suggest:
- merge this PR now
- if there is an issue with the locations of the tests I've added open an issue and assign it to me
- I'll provide a PR to put the new tests in the right place
These tests do not require an implementation, those are tests that verify the Javadoc just using the API jar. Of course only a little can be tested without the implementation, depending on how much functionality the API classes provide. |
@Override | ||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | ||
ServerContainer sc = (ServerContainer) getServletContext().getAttribute("jakarta.websocket.server.ServerContainer"); | ||
ServerEndpointConfig sec = ServerEndpointConfig.Builder.create(WSTestServer.class, "/TCKTestServer").build(); |
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.
@markt-asf The test application war is ws_spec_upgradehttp_web.war
. So it creates context path ws_spec_upgradehttp_web
for the endpoints. The TCKTestServer
endpoint gets deployed when the war is deployed.
But then, ServerEndpointConfig.Builder.create(WSTestServer.class, "/TCKTestServer").build()
creates the endpoint config with the /TCKTestServer
path and it is not matched with /ws_spec_upgradehttp_web/TCKTestServer
. Should the path here contain the context path?
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.
No. As per the Javadoc for Builder, the path is relative to the "web socket root" which is, as per section 6.5 of the WebSocket spec, the Servlet context root of the web application.
Hi @markt-asf , We have 3 test failures in websocket TCK for tests fixed/added in this PR. FAILED........com/sun/ts/tests/websocket/ee/jakarta/websocket/server/serverendpointconfig/WSClient.java#getUserPropertiesTest_from_standalone Full logs : https://ci.eclipse.org/jakartaee-tck/blue/rest/organizations/jenkins/pipelines/jakartaee-tck/branches/master/runs/1662/nodes/45/steps/56/log/?start=0 |
The two The root cause of the |
I can't be 100% without access to the Glassfish logs and I'm not set up to run the TCK with Glassfish locally but the |
Glassfish server logs from my local run : server.log |
Tx. Confirmed as a Glassfish issue:
|
serverendpointconfig/WSClient.java#getUserPropertiesTest seems to be wrong to me anyway:
|
The behaviour in this area has been clarified for WebSocket 2.1 as there were differences in behaviour between containers. The clarifications, including the associated commit, can be found in WebSocket issue 235.
What this means for this test for request 1 is:
For request 2, the expected behaviour is exactly the same. None of the changes made to user properties during request 1 should be visible to request 2. From the description above it sounds like |
@markt-asf Thanks for the reply.
I very much disagree:
|
I have challenged the test: #873 |
Since this PR has already been merged, I'll respond in #873. |
name: Pull Request
about: Create a pull request for a Platform TCK change
title: 'WebSocket 2.1 updates'
labels: ''
assignees: ''
Fixes Issue
None
Related Issue(s)
None.
Describe the change
Updates to TCK for changes in WebSocket 2.1 specification
Additional context
CC @alwin-joseph @anajosep @arjantijms @cesarhernandezgt @dblevins @m0mus @edbratt @gurunrao @jansupol @jgallimore @kazumura @kwsutter @LanceAndersen @bhatpmk @RohitKumarJain @shighbar @gthoman @brideck @scottmarlow