quarkus-quickstarts icon indicating copy to clipboard operation
quarkus-quickstarts copied to clipboard

Fix join message in websocket quickstart

Open mocenas opened this issue 1 year ago • 7 comments

There should be a "joined" message on user joining, but no message is acctually sent.

No "ready" message is generated on user joining, so move this message to user incoming.

Relates to https://github.com/quarkusio/quarkus/pull/35061

Check list:

Your pull request:

  • [x] targets the development branch
  • [x] uses the 999-SNAPSHOT version of Quarkus
  • [ ] has tests (mvn clean test)
  • [ ] works in native (mvn clean package -Pnative)
  • [ ] has integration/native tests (mvn clean verify -Pnative)
  • [ ] makes sure the associated guide must not be updated
  • [x] links the guide update pull request (if needed)
  • [ ] updates or creates the README.md file (with build and run instructions)
  • [ ] for new quickstart, is located in the directory component-quickstart
  • [ ] for new quickstart, is added to the root pom.xml and README.md

mocenas avatar Jul 27 '23 12:07 mocenas


:waning_crescent_moon: This workflow status is outdated as a new workflow run has been triggered.


Failing Jobs - Building a3f84126ef08a3bf4fb20c92517f79455dd49feb

Status Name Step Failures Logs Raw logs
Build - JDK 11 Build with Maven Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

:gear: Build - JDK 11 #

- Failing: websockets-quickstart 

:package: websockets-quickstart

org.acme.websockets.ChatTest.testWebsocketChat line 31 - More details - Source on GitHub

org.opentest4j.AssertionFailedError: expected: <User stu joined> but was: <>> stu: _ready_>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)

quarkus-bot[bot] avatar Jul 28 '23 14:07 quarkus-bot[bot]

@mocenas actually, it looks like your assumptions were incorrect? Could you get to the bottom of it?

gsmet avatar Jul 28 '23 14:07 gsmet

I think this is related to the test here: https://github.com/quarkusio/quarkus-quickstarts/blob/main/websockets-quickstart/src/test/java/org/acme/websockets/ChatTest.java#L45

gsmet avatar Jul 28 '23 14:07 gsmet

I see we have another fix proposal here: https://github.com/quarkusio/quarkus-quickstarts/pull/1305/files

gsmet avatar Jul 28 '23 14:07 gsmet

@gsmet Code changes were probably OK, only that tests relied on the old behaviour (it actually seems that entire "ready" message was there just for test purposes). I changed the tests to work with new behaviour.

mocenas avatar Aug 07 '23 09:08 mocenas

Comparing this PR to #1305 this one is more complex, but gets rid of the "ready" message entirely. Which also means that the ready message will not pop up in the chat.

mocenas avatar Aug 07 '23 09:08 mocenas

:heavy_check_mark: The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

quarkus-bot[bot] avatar Aug 07 '23 10:08 quarkus-bot[bot]