-
Notifications
You must be signed in to change notification settings - Fork 25
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 e2e test flakiness #9249
Fix e2e test flakiness #9249
Conversation
Playwright test resultsDetails
Flaky testsmsedge-setup › setup/unaffiliated.setup.ts › authenticate with unaffiliated user Skipped testschrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main pixiebrix/pixiebrix-extension#9249 +/- ##
==========================================
+ Coverage 74.24% 75.09% +0.84%
==========================================
Files 1332 1369 +37
Lines 40817 42257 +1440
Branches 7634 7882 +248
==========================================
+ Hits 30306 31733 +1427
- Misses 10511 10524 +13 ☔ View full report in Codecov by Sentry. |
@@ -74,7 +81,7 @@ export class ModsPage extends BasePageObject { | |||
const contentLoadedLocator = this.getByText("Welcome to PixieBrix!").or( | |||
this.modTableItems.nth(0), | |||
); | |||
await expect(contentLoadedLocator).toBeVisible({ timeout: 15_000 }); | |||
await expect(contentLoadedLocator).toBeVisible(); |
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.
A lot of these changes were to remove the timeout since we prefer using the global timeout unless we need to specify a longer time to wait.
@@ -85,7 +85,7 @@ export const test = mergeTests( | |||
); | |||
|
|||
// The admin console automatically opens a new tab to log in and link the newly installed extension to the user's account. | |||
const page = await context.waitForEvent("page", { timeout: 10_000 }); | |||
const page = await context.waitForEvent("page", { timeout: 20_000 }); |
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.
A lot of these timeout bumps are just to align with the new default global assertion timeout of 20s, but in the future we could go through and see which ones we can tweak.
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.
I imagine you already looked into a global setting for these? Alternatively, let's introduce a global constant so that we don't have to continually update all of these
# - .editorconfig | ||
# - LICENSE | ||
# - "**.iml" | ||
# - .idea/** |
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 this come up in this PR? Or somewhere else?
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.
Yea, it came up at the start of this pr when I just made a simple readme change.
You can also pass in the run id instead if you want to view a specific run's report. | ||
|
||
```bash | ||
./scripts/show-pr-e2e-report.sh -r <run-id> |
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.
❤️
const saveNewModModal = this.page.locator(".modal-content"); | ||
await expect(saveNewModModal).toBeVisible(); | ||
await expect(saveNewModModal.getByText("Save new mod")).toBeVisible(); | ||
// The save button re-mounts several times so we need to retry clicking the saveButton until the modal is visible |
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.
I've actually run into this as a user before (i.e. it's not just a testing papercut); do we have a ticket for this issue? Let's open one before merging
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.
I re-opened https://github.com/pixiebrix/pixiebrix-extension/issues/8458
Actually this is a separate issue. I can open one.
// predicate: (request) => | ||
// request.url().includes(API_PATHS.REGISTRY_BRICKS), | ||
// timeout: 30_000, | ||
// }); |
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.
Did you mean to keep these commented out?
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.
In the latest change I wanted to see if I could remove this. Seems like currently we still need them for a few other tests.
playwright.config.ts
Outdated
trace: CI ? "on-first-retry" : "retain-on-failure", | ||
// trace: CI ? "on-first-retry" : "retain-on-failure", | ||
// temporarily always collect trace on failure to debug flaky tests | ||
trace: "retain-on-failure", |
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.
Just to clarify, will we be retaining this setting on main for now? Or was this just to facilitate your debugging?
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, it's just for this PR. I'll revert back to the previous setting once I have things in a good state before merging
No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack. Do not edit this comment manually. |
What does this PR do?
Discussion
Future Work
Checklist
For more information on our expectations for the PR process, see the
code review principles doc