perf(e2e): poll every 1s in E2E test environment#358
Open
douglance wants to merge 1 commit into
Open
Conversation
Add e2ePollingInterval() helper that returns a 1s interval when isE2eTestingEnvironment is set, and use it for balance and tx-history polling. Production intervals (10s/15s/30s) are unchanged.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a small utility to reduce polling intervals specifically when running in an E2E testing environment, improving E2E test runtime while preserving production polling behavior.
Changes:
- Introduced
e2ePollingInterval(productionMs)helper gated byisE2eTestingEnvironmentto return1_000msin E2E and the original interval otherwise. - Updated SWR polling in balance-related hooks to use the helper (15s/30s in prod; 1s in E2E).
- Updated interval-based polling for transaction-history pending updates and balance syncer to use the helper (10s in prod; 1s in E2E).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/arb-token-bridge-ui/src/util/CommonUtils.ts | Adds e2ePollingInterval() helper keyed off existing E2E env detection. |
| packages/arb-token-bridge-ui/src/hooks/useNativeCurrencyBalanceForChainId.ts | Uses E2E-aware refresh interval for native balance SWR polling. |
| packages/arb-token-bridge-ui/src/hooks/useBalance.ts | Uses E2E-aware refresh interval for ETH balance SWR polling. |
| packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionHistorySearchResults.tsx | Uses E2E-aware interval for pending transaction status updates. |
| packages/arb-token-bridge-ui/src/components/syncers/useBalanceUpdater.tsx | Uses E2E-aware interval for periodic balance/token-data updates via useInterval. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Adds an
e2ePollingInterval()helper that returns a 1s polling interval when running underisE2eTestingEnvironment, and uses it for balance and transaction-history polling. This speeds up E2E tests (faster balance/tx-history refresh) without changing production behavior.Production intervals are unchanged — the helper returns the original value (10s/15s/30s) whenever not in the E2E environment.
Changes
CommonUtils.ts— newe2ePollingInterval(productionMs)helperuseBalance.ts(15s),useNativeCurrencyBalanceForChainId.ts(30s),useBalanceUpdater.tsx(10s),TransactionHistorySearchResults.tsx(10s) — use the helperContext
Split out of #357 (testnode service-container switch) to keep that PR CI/test-only. This is the production-touching half; the env guard makes it a no-op outside E2E.