Skip to content

perf(e2e): poll every 1s in E2E test environment#358

Open
douglance wants to merge 1 commit into
masterfrom
dl/e2e-polling-speedup
Open

perf(e2e): poll every 1s in E2E test environment#358
douglance wants to merge 1 commit into
masterfrom
dl/e2e-polling-speedup

Conversation

@douglance

Copy link
Copy Markdown
Contributor

Summary

Adds an e2ePollingInterval() helper that returns a 1s polling interval when running under isE2eTestingEnvironment, 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 — new e2ePollingInterval(productionMs) helper
  • useBalance.ts (15s), useNativeCurrencyBalanceForChainId.ts (30s), useBalanceUpdater.tsx (10s), TransactionHistorySearchResults.tsx (10s) — use the helper

Context

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.

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.
Copilot AI review requested due to automatic review settings June 16, 2026 15:23
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
arbitrum-portal Ready Ready Preview Jun 16, 2026 3:29pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 by isE2eTestingEnvironment to return 1_000ms in 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.

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