-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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 Speed Up and Cancel Transaction Tests Cancel transaction Successfully cancels a pending transaction
#30435
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. |
@@ -28,10 +27,9 @@ describe('Speed Up and Cancel Transaction Tests', function () { | |||
.withPermissionControllerConnectedToTestDapp() | |||
.build(), | |||
localNodeOptions: defaultGanacheOptionsForType2Transactions, | |||
smartContract: SMART_CONTRACTS.PIGGYBANK, |
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 is not needed in this spec, as we are not interacting with any smart contract
@@ -79,10 +78,9 @@ describe('Speed Up and Cancel Transaction Tests', function () { | |||
.withPermissionControllerConnectedToTestDapp() | |||
.build(), | |||
localNodeOptions: defaultGanacheOptionsForType2Transactions, | |||
smartContract: SMART_CONTRACTS.PIGGYBANK, |
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 is not needed in this spec, as we are not interacting with any smart contract
@@ -93,11 +91,11 @@ describe('Speed Up and Cancel Transaction Tests', function () { | |||
to: DEFAULT_FIXTURE_ACCOUNT, | |||
}); | |||
|
|||
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.
not needed as it's handled in the below method
@@ -43,7 +41,6 @@ describe('Speed Up and Cancel Transaction Tests', function () { | |||
}); | |||
|
|||
// Wait for confirmation dialog and confirm initial transaction | |||
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.
not needed as it's done in the below step
Builds ready [bfee23b]
Page Load Metrics (1650 ± 37 ms)
Bundle size diffs
|
Description
In our ganache instance, auto-mining is set with
blockTime: 2
, so a new block is mined every 2 seconds.In the specs cancel/speed up, we are sending a transaction with low gas, so then we can speed it up/cancel. The problem is if this whole confirm and speed up/cancel, happens in the same block (within the 2 seconds).
Then the transaction stays forever in a Pending state, and the spec fails as it cannot find the correct tx status.
To fix this, we can make sure that we are working with a deterministic block behaviour. So after we confirm the tx we mine a block, and after we speed up/cancel, we mine another block.
Ci failure: https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/125141/workflows/92ff1531-7350-490d-bfd1-811098db7535/jobs/4556227/tests
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist