Skip to content
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

fix: intermittent e2e failures #15

Merged
merged 4 commits into from
Aug 6, 2024
Merged

Conversation

meeh0w
Copy link
Member

@meeh0w meeh0w commented Aug 2, 2024

Description

no ticket, favour to my beloved QAs 😄

Changes

Make it so that getting the cached list from storage throws error if nothing is found.
This allows us to use Promise.any(...) instead of Promise.race(...) - we'll essentially get the first promise that gives us a value.

This is essential for E2E tests where QAs remove the storage-cached network list, since they are really big and they don't want it in their repos.

Testing

  • Restart extension many times (as in, along with the service worker, not just the popup). Just make sure this doesn't break anything for actual humans :)

Checklist for the author

  • I've covered new/modified business logic with Jest test cases.
  • I've tested the changes myself before sending it to code review and QA.

@meeh0w meeh0w marked this pull request as ready for review August 2, 2024 20:57
@@ -326,7 +326,8 @@ export class NetworkService implements OnLock, OnStorageReady {
// At this point the chainlist from Glacier should already be available,
// as it is fetched when service worker starts (so before extension is unlocked).
// If it isn't available yet, we'll use the list cached in the storage.
const chainlist = await Promise.race([

const chainlist = await Promise.any([
Copy link
Contributor

@gergelylovas gergelylovas Aug 6, 2024

Choose a reason for hiding this comment

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

We should add a test for this to make sure what gets fixed here, stays fixed.

@bferenc bferenc merged commit 00c212b into main Aug 6, 2024
4 of 5 checks passed
@bferenc bferenc deleted the fix/e2e-intermittent-failrues branch August 6, 2024 16:33
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.

5 participants