Skip to content

Conversation

Copy link

Copilot AI commented Jan 25, 2026

Plan to Fix Test Assertion Handling in StandardWebSocketClientMultiMessageTest

This PR addresses the feedback that test assertions running in background threads are not properly surfaced to JUnit.

Changes Needed

  • Refactor testAccumulatesMessagesUntilEose to capture exceptions from worker thread
  • Refactor testCompletesImmediatelyOnOk to capture exceptions from worker thread
  • Refactor testEventWithoutEoseTimesOut to capture exceptions from worker thread
  • Add proper exception propagation mechanism using AtomicReference<Throwable>
  • Ensure all assertions are checked in the main test thread after worker completes
  • Verify all tests pass with the new implementation

Approach

Instead of throwing RuntimeException in the worker threads, we'll:

  1. Use AtomicReference<Throwable> to capture any exceptions from the worker thread
  2. After join(), check if an exception was captured and rethrow it in the main thread
  3. Move assertions to the main thread where possible, or properly propagate them

This ensures that if send() blocks indefinitely, times out unexpectedly, or returns incorrect results, the test will properly fail.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@tcheeric tcheeric marked this pull request as ready for review January 25, 2026 21:24
@tcheeric tcheeric merged commit a2c93f8 into fix/relay-default-values Jan 25, 2026
1 of 2 checks passed
@tcheeric tcheeric deleted the copilot/sub-pr-505-again branch January 25, 2026 21:24
Copilot AI requested a review from tcheeric January 25, 2026 21:24
Copilot stopped work on behalf of tcheeric due to an error January 25, 2026 21:24
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.

2 participants