Skip to content

fix: flaky test Change assets changes to native currency when switching accounts during a NFT send#25220

Merged
seaona merged 4 commits intodevelopfrom
flaky-create-assets-currency
Jun 12, 2024
Merged

fix: flaky test Change assets changes to native currency when switching accounts during a NFT send#25220
seaona merged 4 commits intodevelopfrom
flaky-create-assets-currency

Conversation

@seaona
Copy link
Copy Markdown
Member

@seaona seaona commented Jun 11, 2024

Description

The problem with this flaky test is that we start a send flow (type 0x0 tx), and we are switching assets (from NFT to ETH) and proceeding to the next screen, if we click Continue before the gasLimit is updated the test will fail: once we land into the last confirmation screen, the gas limit is never updated there, so the test fails as the total value doesn't match with the expected one.

This is a race condition that happens on the wallet level, but this PR intends to fix the flakiness on the test level to not wait for the fix on the wallet side.
See bug here.

To fix this, we could either add a delay, or in this case, we add some extra validation (making sure the hex data is cleared) and update the transaction values, to trigger again a gas update.

Open in GitHub Codespaces

Related issues

Fixes: #25181

Manual testing steps

  1. Check ci
  2. Run test multiple times locally FIREFOX_SNAP=true yarn test:e2e:single test/e2e/tests/transaction/change-assets.spec.js --browser=firefox --leave-running --retryUntilFailure --retries=10

Screenshots/Recordings

gaslimit-asset-old.mp4

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.

@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.

@seaona seaona added team-extension-platform Extension Platform team flaky tests labels Jun 11, 2024
@seaona seaona self-assigned this Jun 12, 2024
@seaona seaona marked this pull request as ready for review June 12, 2024 06:43
@seaona seaona requested a review from a team as a code owner June 12, 2024 06:43
@codecov
Copy link
Copy Markdown

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.64%. Comparing base (9a5aeae) to head (3a213b5).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #25220   +/-   ##
========================================
  Coverage    65.64%   65.64%           
========================================
  Files         1367     1367           
  Lines        54257    54257           
  Branches     14189    14189           
========================================
  Hits         35616    35616           
  Misses       18641    18641           

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

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [3a213b5]
Page Load Metrics (52 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint721098694
domContentLoaded9161121
load39625263
domInteractive9161121
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

await logInWithBalanceValidation(driver, ganacheServer);

// Wait for balance to load
await driver.delay(500);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is not needed as we already apply the logInWithBalanceValidation

@seaona seaona merged commit 9c87c1b into develop Jun 12, 2024
@seaona seaona deleted the flaky-create-assets-currency branch June 12, 2024 16:30
@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

flaky tests release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-extension-platform Extension Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

flaky test: Change assets changes to native currency when switching accounts during a NFT send

4 participants