-
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 "Test Snap Cronjob can trigger a cronjob to open a di..." flaky tests #28154
Comments
The flakiness initially reported in the ticket, has been fixed in the PR #27684. But when this PR #28153 was unable to be merged, a discussion took place in the slack channel and this flaky test appeared with another reason details in the CI link. According to the log, the failure occurs in the Chrome browser when the delay |
…tests (#28363) <!-- 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** This flaky test is due to the dialog taking time to appear and disappear, which is the expected behavior. I have attached a video demonstrating the current behavior. https://github.com/user-attachments/assets/66c68d05-a2dc-4bb5-8870-c967ea9d630a To address this issue, I added retry logic and validation. However, I noticed that when the dialog does not appear, `switchToWindowWithTitle` method throws an exception and fails the test hence causing the retry logic to be ineffective. Implementation is in the first commit in this PR b97dbbe. Fixing this issue within the framework would require significant effort and could impact other tests. Therefore, I have implemented a wait period before attempting to switch to the window. This approach ensures that the dialog has enough time to appear, thereby reducing the likelihood of test failures. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28363?quickstart=1) ## **Related issues** Fixes: #28154 ## **Manual testing steps** Run the test locally or in codespaces using below command yarn yarn build:test:webpack ENABLE_MV3=false yarn test:e2e:single test/e2e/snaps/test-snap-cronjob.spec.js --browser=chrome --leave-running ## **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/develop/.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 - [ ] 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/develop/.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.
CI failure reported on Oct 31 (Test Snap Cronjob can trigger a cronjob to open a di...)
Build - Flask
Browser - Chrome
Test Path - /test/e2e/snaps/test-snap-cronjob.spec.js
Test Scenario - Test Snap Cronjob can trigger a cronjob to open a dialog every minute
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/108186/workflows/1dc73b8c-a92d-4e87-a378-39d8db2563e2/jobs/4046081/tests#failed-test-0
Build - Flask
Browser - Firefox
Test Path - /test/e2e/snaps/test-snap-cronjob.spec.js
Test Scenario - Test Snap Cronjob can trigger a cronjob to open a dialog every minute
The text was updated successfully, but these errors were encountered: