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: flaky test Swap Eth for another Token @no-mmi Completes a Swap between ETH and DAI after changing initial rate #27022

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

seaona
Copy link
Contributor

@seaona seaona commented Sep 10, 2024

Description

This test is fetching the swap quote to the live server, instead of using mocks. This can cause the test to be unstable, if the response takes too long.

The error appears when then the quotes timer is reset and we cannot find the 0:25 element (as we are around 0:46s)

TimeoutError: Waiting for element to be located By(xpath, .//*[./@data-testid = 'countdown-timer__timer-container'][(contains(string(.), '0:25') or contains(string(.), '0:25'))]).

Open in GitHub Codespaces

Related issues

Fixes: #27023

Manual testing steps

  1. Check ci

Screenshots/Recordings

The swap request for quotes is not mocked, taking a non-deterministic time to get a response, hence making the test unstable.
See for example, this case, where the request took almost 3 seconds to resolve:

Screenshot from 2024-09-10 13-56-53

swap-quote-not-mocked.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.

@seaona seaona requested a review from a team as a code owner September 10, 2024 11:54
Copy link
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 self-assigned this Sep 10, 2024
@seaona seaona added flaky tests area-qa Relating to QA work (Quality Assurance) labels Sep 10, 2024
Copy link

@metamaskbot
Copy link
Collaborator

Builds ready [2b76ae3]
Page Load Metrics (1743 ± 102 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint24224851610509245
domContentLoaded15022258171418890
load151323821743212102
domInteractive13135392814
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@hjetpoluru hjetpoluru merged commit dcb8284 into develop Sep 11, 2024
110 of 111 checks passed
@hjetpoluru hjetpoluru deleted the fix-mock-swap-dai branch September 11, 2024 14:30
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Sep 11, 2024
@metamaskbot metamaskbot 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 29, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix "Swap Eth for another Token @no-mmi Completes a Swap ..." flaky tests
5 participants