Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: flaky test `Speed Up and Cancel Transaction Tests Cancel transac…
…tion Successfully cancels a pending transaction` (#30435) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **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 [](https://codespaces.new/MetaMask/metamask-extension/pull/30435?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Check ci webpack job https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/126169/workflows/f76d3a08-d90e-4cae-8033-897e85cf29d6/jobs/4563925 ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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.
- Loading branch information