-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 Request Queuing Dapp 1, Switch Tx -> Dapp 2 Send Tx should queue send tx after switch network confirmation and transaction should target the correct network after switch is confirmed
#27352
Conversation
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. |
@@ -51,17 +49,15 @@ describe('Request Queuing Dapp 1, Switch Tx -> Dapp 2 Send Tx', function () { | |||
await driver.findClickableElement({ text: 'Connect', tag: 'button' }); | |||
await driver.clickElement('#connectButton'); | |||
|
|||
await driver.delay(regularDelayMs); | |||
|
|||
await switchToNotificationWindow(driver); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed deprecated method and using the correct one (no need to add the delay)
@@ -80,9 +76,6 @@ describe('Request Queuing Dapp 1, Switch Tx -> Dapp 2 Send Tx', function () { | |||
css: 'p', | |||
}); | |||
|
|||
// Wait for the first dapp's connect confirmation to disappear | |||
await driver.waitUntilXWindowHandles(2); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to add this, as we handle the close window into the `clickElementAndWaitForWindowToClose
Quality Gate passedIssues Measures |
// Wait for switch confirmation to close then tx confirmation to show. | ||
await driver.waitUntilXWindowHandles(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this point is where test breaks in webpack: if the next dialog window is opened really fast, this condition is never met
|
||
// Wait for switch confirmation to close then tx confirmation to show. | ||
await driver.waitUntilXWindowHandles(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this point is where test breaks in webpack: if the next dialog window is opened really fast, this condition is never met
Builds ready [c1e9a64]
Page Load Metrics (1739 ± 85 ms)
Bundle size diffs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for me the fix ! Thanks !
Description
There is a race condition with window management that makes this test fail quite often. The test performs these actions and there are different behaviors happening, depending on the build:
Error: waitUntilXWindowHandles timed out polling window handles. Expected: 3, Actual: 4
)Extra Notes:
This PR fixes the flakiness of waiting for 3 windows by adding a delay. This won't fix the root cause of the 2 new identified issues, but after re-runs has proven to stabilize the test
Since there is only a brief moment for having 3 windows, waiting for 3 windows and then proceeding also makes the test flaky, so it's not effective.
Related issues
Fixes: #27387
Manual testing steps
yarn test:e2e:single test/e2e/tests/request-queuing/dapp1-switch-dapp2-send.spec.js --browser=chrome
Screenshots/Recordings
Problem in FF and Webpack, see how popup is open and closed, and then a new popup is open with the transaction.
ff-dialog-open-close.mp4
Problem in Webpack, where tx does not open after the change networks
webpack-send-tx-not-appear.mp4
Problem Webpack, see how popup is open and closed, and then a new popup is open with the transaction.
webpack-2-txs.mp4
Pre-merge author checklist
Pre-merge reviewer checklist