-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
test: allocate resource ports dynamically #22158
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
Conversation
…tion - Introduced PortManager to handle port allocation and release for various servers. - Updated Ganache, MockServerE2E, DappServer, CommandQueueServer, FixtureServer, and AnvilManager to utilize PortManager for setting and releasing ports. - Added methods to set server ports and handle server status in respective classes. - Implemented retry logic for starting resources with automatic port management to avoid conflicts. - Updated FixtureUtils to include new port management functions and ensure correct RPC URLs are used based on allocated ports.
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…al node management
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22158 +/- ##
==========================================
+ Coverage 77.02% 77.39% +0.36%
==========================================
Files 3805 3805
Lines 97085 96984 -101
Branches 18926 18911 -15
==========================================
+ Hits 74781 75057 +276
+ Misses 17164 16786 -378
- Partials 5140 5141 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…odes fixture urls
…ynamic-port-allocation
…ynamic-port-allocation
- Updated PortManager to use ResourceType instead of ResourceId for better clarity and maintainability. - Introduced new methods for handling multi-instance resources and automatic port forwarding for Android. - Refactored FixtureUtils to provide fallback ports for fixture data construction. - Updated various fixture-related classes to utilize new port management methods. - Removed deprecated functions and ensured backward compatibility where necessary. - Improved logging for resource allocation and port management.
…ility and remove translateFallbackPortToActual in mockserver
88511b1 to
96dd1e5
Compare
…e its visibility for better testability
…tance is not available
…amask-mobile into e2e/dynamic-port-allocation
| for (let i = 1; i <= extraTabs; i++) { | ||
| this.fixture.state.browser.tabs.push({ | ||
| url: getTestDappLocalUrlByDappCounter(i), | ||
| url: getDappUrl(i), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Premature Port Access Breaks Fixture Construction
Calling getDappUrl(i) during fixture construction will fail on iOS because it calls getDappPort() which accesses PortManager before ports are allocated. This should use getDappUrlForFixture(i) instead, which returns fallback ports safe for fixture construction. On Android this works by coincidence since getDappUrl() returns fallback ports, but iOS will throw an error.
christopherferreira9
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM great work!
|
OGPoyraz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmation changes LGTM



Description
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Adds PortManager-driven dynamic port allocation with retries and platform handling, refactors test servers/utilities to use it, migrates swaps tests to Anvil, and standardizes “Network fee” casing.
PortManagerfor dynamic/random port allocation (single/multi-instance), release, and BrowserStack fallbacks; adds robust retry start helpers (startResourceWithRetry,startMultiInstanceResourceWithRetry).adb reversemapping, iOS LaunchArgs, and MockServer host-side fallback→actual port translation.Ganache,AnvilManager,FixtureServer,CommandQueueServer,DappServer,MockServerE2EtosetServerPort, track status, and release ports;DappServersupports multi-instance.FixtureUtils/FixtureHelperAPIs (getDappUrl*,get*PortForFixture, RPC/Dapp URL rewrites) and improves network-store/shim host resolution.PortManager.test.ts.Network feeacross tests andlocales/languages/en.json.Written by Cursor Bugbot for commit f63e958. This will update automatically on new commits. Configure here.