Improve RPC and WebSocket test reliability and error handling#128
Draft
Improve RPC and WebSocket test reliability and error handling#128
Conversation
Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [Feature] Improve RPC and WebSocket test reliability and error handling
Improve RPC and WebSocket test reliability and error handling
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both test scripts had silent failure modes:
rpc_test.pyswallowed RPC-level errors (e.g.{"error": {"code": -32000}}), andwebsocket_test.pycould loop indefinitely with no exit criteria or CI-detectable failure signal.rpc/rpc_test.pyresultand noerrorfield — RPC-level errors now surface as failurestest_chain_idparses and validates the returned hex chain ID against the expected valueAssertionErrorinstead of being silently printedsys.exit(1)on any failure; all tests run and report individually before exitrpc/websocket_test.pywhile Trueloop with a bounded loop: exits whenmin_eventsreceived ortotal_timeoutelapsedtime.monotonic()deadline passed directly toasyncio.wait_for— single clean timeout, no restart-looperrorfield--timeout(default 120s) and--min-events(default 1) CLI argsasyncio.gather(..., return_exceptions=True)isolates per-endpoint failuressys.exit(0/1)for CI/CD pipeline detection# Configurable timeout and success threshold python websocket_test.py --timeout 60 --min-events 3Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.