Skip to content

Conversation

@hyphenized
Copy link
Collaborator

@hyphenized hyphenized commented Feb 14, 2025

This updates fork tests to run on anvil instead of hardhat. The change significantly improves test speed and prevents hangups. Even for simple cases anvil performs better without a cache.

Latest build: extension-builds-3781 (as of Mon, 08 Dec 2025 04:45:46 GMT).

Removes dependency on env vars and adds a script shortcut to run fork tests
This will come useful when we need a deterministic name for test
assertions.
Previous approach would have missed updates if a price fetch was requested
after detecting a new token balance. This also increases the frequency of
price updates.
Since local nodes require higher gas to fulfill read only calls these would
sometimes fail silently when done through multicall.
This updates fork tests to run on anvil instead of hardhat. The change
significantly improves test speed and prevents hangups. Even for simple
cases anvil performs better without a cache.
@hyphenized hyphenized force-pushed the testing-tests-e2e-fork branch 6 times, most recently from 1c43fb9 to 089cc93 Compare February 15, 2025 23:08
These should be consistent between local/ci
By sending sigint to the process this script will stall until anvil
polled requests finish so it can flush the cache to disk before the job
completes
These are meant to help identify price loading has completed for a given
asset
Normalizes balances to ensure tests work when the CI account differs from
the one used locallly
@hyphenized hyphenized force-pushed the testing-tests-e2e-fork branch from 896beee to 402a6d9 Compare February 24, 2025 07:04
@mhluongo
Copy link
Contributor

You interested in help getting this over the line ser? Seems worthwhile

@hyphenized
Copy link
Collaborator Author

You interested in help getting this over the line ser? Seems worthwhile

Yes I agree, I was planning on bringing this back to life after the other PR since I have to spend some time syncing the CI cache... though perhaps I can find a way to do this faster now 😄

Helps reducing call i/o size, reducing the chance an rpc shrugs the
final request due to payload limits
This fixes the problem with some tokens where calling BigInt directly over the
response data resulted in an infinite balance being returned and
displayed to the user.
This assertion changed with da31038, which fixed invalid balances
being shown.
@hyphenized hyphenized force-pushed the testing-tests-e2e-fork branch 2 times, most recently from 776fdba to 407632c Compare December 8, 2025 04:37
@hyphenized hyphenized self-assigned this Dec 8, 2025
@hyphenized hyphenized force-pushed the testing-tests-e2e-fork branch from 407632c to a4acb02 Compare December 8, 2025 21:45
@hyphenized hyphenized mentioned this pull request Dec 8, 2025
3 tasks
Some minor changes were made to the format and url. One of the breaking
changes includes solana token addresses in the list that now have to be
filtered before validating the list.
This makes more sense for activity loading as balances and assets are
loaded within the first 30 seconds of adding an account through alchemy
and multicall.
Introduced explicit refresh intervals for token lists, active-account balances,
and all-account balances. Added dedicated timers and a scheduling pattern.
These were buggy due to the duplicate transition elements in the popup.
Additionally assertions for snackbars that don't appear immediately resolve
as passed.

Another issue is that even though it's technically not visible, elements with 0
opacity are still considered visible by playwright. This adds a testid to a
span wrapper inside the snackbar, so the `toBeVisible` matcher works.
This appears to be running before the page has rendered
These broke with the playwright update, also removes a couple of
timeouts
At most basic tests take as much as one minute each. For longer, bigger
tests, an override can be set per test via `test.setTimeout`
These are enabled by default
Sets dump state interval to every 10s and a request retry backoff of .1s
If tracked assets change, queue price discovery for the new assets
Lookups for multiple assets were failing silently, specially on a forked
node, with multicall succeeding at most with 2 queries.
@hyphenized hyphenized force-pushed the testing-tests-e2e-fork branch from a4acb02 to 2322167 Compare December 9, 2025 01:13
This prevents custom assets discovered through alchemy from not being displayed
until after the next balance refresh cycle.
@hyphenized
Copy link
Collaborator Author

I think this is good for a review. I'd prefer to pull a couple of changes into different PRs (e.g. #3826) so it gets lighter though. As it turns out a big part of the bottleneck on the e2e tests came from very generous timeout settings.. In any case, let me know if we should review this as a single piece or split it. (Tagging @mhluongo and @Shadowfiend for visibility).

@hyphenized hyphenized marked this pull request as ready for review December 9, 2025 02:54
@hyphenized hyphenized requested a review from a team as a code owner December 9, 2025 02:54
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.

3 participants