fix(p2p): fix websocket log line parsing in exec p2p/simulations adapter #16667#2008
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This pull request fixes a bug in the WebSocket log line parsing for the p2p/simulations exec adapter. The issue was that the code was looking for a log message with "WebSocket endpoint opened:" (with a colon), but the actual log message produced by the node is "WebSocket endpoint opened" (without a colon). This caused the exec adapter to timeout when trying to start nodes in simulations.
Changes:
- Fixed the WebSocket endpoint log message string matching to remove the incorrect colon
- Refactored the WebSocket address parsing logic into a separate file (
ws.go) for better code organization - Added test coverage for the WebSocket address parsing functionality
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| p2p/simulations/adapters/ws.go | New file containing extracted WebSocket address parsing logic with the bug fix |
| p2p/simulations/adapters/ws_test.go | New test file validating the WebSocket address parsing functionality |
| p2p/simulations/adapters/exec.go | Refactored to use the extracted functions, removing inline WebSocket parsing code |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e6745c9 to
cd0bb7f
Compare
Proposed changes
Ref: ethereum#16667
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which part of the codebase this PR will touch base on,
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that