Skip to content

fix: flaky test Request Queuing Dapp 1, Switch Tx -> Dapp 2 Send Tx should queue signTypedData tx after eth_sendTransaction confirmation and signTypedData confirmation should target the correct network after eth_sendTransaction is confirmed @no-mmi#26794

Merged
hjetpoluru merged 1 commit intodevelopfrom
fix-flaky-queue-test
Aug 30, 2024

Conversation

@seaona
Copy link
Copy Markdown
Member

@seaona seaona commented Aug 30, 2024

Description

There is a race condition which happens when we trigger a Send from Dapp 1 (Localhost 7777) and quickly switch to Dapp 0 (Localhost 8545) and trigger a Sign there.

What happens is that the network for the first Send, is taken for the one on Dapp 0 (localhost 8545), so when we try to find the correct network (7777) in the Send screen fails (see artifacts below).

// Check correct network on the send confirmation.
        await driver.findElement({
          css: '[data-testid="network-display"]',
          text: 'Localhost 7777',
        });

To mitigate this race condition, after we trigger the Send from Dapp 1 (Localhost 7777) we wait until the popup is open and then switch to Dapp 0 and proceed with the Sign action (Localhost 8545).

Open in GitHub Codespaces

Related issues

Fixes: #26795

Manual testing steps

  1. Check ci
  2. Run test locally in webpack build yarn test:e2e:single test/e2e/tests/request-queuing/dapp1-send-dapp2-signTypedData.spec.js --browser=chrome --retries=10 --stop-after-one-failure=true

Screenshots/Recordings

Notice the Send has Localhost 8545, but it should be Localhost 7777

image

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@seaona seaona self-assigned this Aug 30, 2024
@seaona seaona added team-extension-platform Extension Platform team area-qa Relating to QA work (Quality Assurance) labels Aug 30, 2024
@github-actions
Copy link
Copy Markdown
Contributor

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.

@sonarqubecloud
Copy link
Copy Markdown

@seaona seaona marked this pull request as ready for review August 30, 2024 06:54
@seaona seaona requested a review from a team as a code owner August 30, 2024 06:54
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.13%. Comparing base (1b4417d) to head (a6114ad).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #26794   +/-   ##
========================================
  Coverage    70.13%   70.13%           
========================================
  Files         1417     1417           
  Lines        49440    49440           
  Branches     13833    13833           
========================================
  Hits         34672    34672           
  Misses       14768    14768           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [a6114ad]
Page Load Metrics (1701 ± 95 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15102291170419795
domContentLoaded15032282167518689
load15112290170119995
domInteractive136127105
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Copy Markdown
Contributor

@chloeYue chloeYue left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fix !

@hjetpoluru hjetpoluru self-requested a review August 30, 2024 12:12
@hjetpoluru hjetpoluru merged commit 714e100 into develop Aug 30, 2024
@hjetpoluru hjetpoluru deleted the fix-flaky-queue-test branch August 30, 2024 12:12
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Aug 30, 2024
@gauthierpetetin gauthierpetetin added release-12.5.0 Issue or pull request that will be included in release 12.5.0 and removed release-12.6.0 Issue or pull request that will be included in release 12.6.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-qa Relating to QA work (Quality Assurance) flaky tests release-12.5.0 Issue or pull request that will be included in release 12.5.0 team-extension-platform Extension Platform team

Projects

Archived in project

5 participants