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

MockWebServer expectSentWebSocketMessage #5713

Closed
manusa opened this issue Jan 17, 2024 · 0 comments · Fixed by #5714
Closed

MockWebServer expectSentWebSocketMessage #5713

manusa opened this issue Jan 17, 2024 · 0 comments · Fixed by #5714
Assignees
Labels
Milestone

Comments

@manusa
Copy link
Member

manusa commented Jan 17, 2024

Description

The current MockWebServer implementation for fabric8io/mockwebserver#38 is "wrong" and doesn't behave as described in the original PR https://github.com/fabric8io/mockwebserver/pull/38/files.

When using expectSentWebSocketMessage we are using a message received through the socket to send a response (this way we can send multiple messages through the socket).

What it's inferred from the description is the implementation of a bidirectional conversation.

  • The server receives an HTTP request
  • The server emits a WS message.
  • The server waits for a given message to be received
  • The server emits a WS message

Discovered in scope of #5632 which fails randomly due to the unexpected implementation.

However the behavior is mostly for an unidirectional conversation:

  • The server receives an HTTP request
  • The server emits a WS message
  • If the message matches the expectation, server sends an additional enqueued message after the original

Proposed fix

In order not to break the current behavior which has been in place for years, update the original test that was updated in #5664

@manusa manusa added the bug label Jan 17, 2024
@manusa manusa self-assigned this Jan 17, 2024
@manusa manusa moved this to In Progress in Eclipse JKube Jan 17, 2024
@manusa manusa added this to the 6.11.0 milestone Jan 18, 2024
@manusa manusa moved this from In Progress to Review in Eclipse JKube Jan 18, 2024
@github-project-automation github-project-automation bot moved this from Review to Done in Eclipse JKube Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant