Skip to content

test: cover the first binary WebSocket frame arriving with the upgrade - #1671

Open
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:test/websocket-first-binary-frame-with-upgrade
Open

He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:test/websocket-first-binary-frame-with-upgrade

Conversation

@He-Pin

@He-Pin He-Pin commented Nov 26, 2026

Copy link
Copy Markdown
Member

Motivation

The WebSocket client suite checks handover when a successful upgrade and the first text frame arrive together. It does not exercise binary frame handover under the same condition.

Modification

Keep the text control and add a binary case. In both cases deliver the successful upgrade response and a valid first frame in one transport input, then check the concrete message type, payload, and successful upgrade result.

Result

The client test now covers the text and binary paths across the HTTP-to-WebSocket handover. Production behavior is unchanged.

Tests

  • JDK 17, Scala 2.13.18 and 3.3.9: the two selected cases passed on each version using the exact changed test source with existing compiled support classes.
  • Native scoped test formatting and license-header checks passed. No full CI run was verified before opening.

References

  • RFC 6455 §4.1 and §5.6
  • Netty 4.2: WebSocketClientHandshakerTest first binary frame handover cases.

Motivation:
The client checks that a text frame survives the HTTP-to-WebSocket
handoff when it arrives with the upgrade response. A binary frame
uses a different message decoding path.

Modification:
Run the same successful upgrade scenario for text and binary frames.
Verify the exact message and successful upgrade, release every probe
in finally, and assert all materialized stages stop.

Result:
Both inbound message types are covered at the upgrade boundary. Each
case stops its streams even when an assertion fails. Production
behavior is unchanged.

Tests:
On JDK 17, three focused cases passed on Scala 2.13.18 and 3.3.9
using the exact test source and current handshake source overlays.
Scoped Scalafmt and git diff --check passed.

References:
RFC 6455 sections 4.1 and 5.6. The binary boundary is inspired by
Netty 4.2 WebSocketClientHandshakerTest.
@He-Pin
He-Pin force-pushed the test/websocket-first-binary-frame-with-upgrade branch from 7c51acb to 3d3e550 Compare November 26, 2026 23:57
@He-Pin
He-Pin requested a review from pjfanning November 26, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant