Skip to content
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

Merged
merged 25 commits into from
Oct 10, 2024
Merged

Fix e2e test flakiness #9249

merged 25 commits into from
Oct 10, 2024

Conversation

fungairino
Copy link
Collaborator

@fungairino fungairino commented Oct 7, 2024

What does this PR do?

Discussion

  • Follow up with @johnnymetz on latency identified in this PR

Future Work

  • Tighten up global timeout when we observe backend performance in a better state.

Checklist

  • Added jest or playwright tests and/or storybook stories

For more information on our expectations for the PR process, see the
code review principles doc

Copy link

github-actions bot commented Oct 7, 2024

Playwright test results

passed  138 passed
flaky  2 flaky
skipped  2 skipped

Details

report  Open report ↗︎
stats  142 tests across 46 suites
duration  13 minutes, 2 seconds
commit  7c6331e
info  For more information on how to debug and view this report, see our readme

Flaky tests

msedge-setup › setup/unaffiliated.setup.ts › authenticate with unaffiliated user
msedge › tests/pageEditor/addStarterBrick.spec.ts › Add new mod with different starter brick components

Skipped tests

chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
msedge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.09%. Comparing base (8318d74) to head (7c6331e).
Report is 360 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@@ -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();
Copy link
Collaborator Author

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 });
Copy link
Collaborator Author

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.

Copy link
Collaborator

@mnholtz mnholtz Oct 10, 2024

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/**
Copy link
Collaborator

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?

Copy link
Collaborator Author

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>
Copy link
Collaborator

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
Copy link
Collaborator

@mnholtz mnholtz Oct 10, 2024

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

Copy link
Collaborator Author

@fungairino fungairino Oct 10, 2024

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,
// });
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

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",
Copy link
Collaborator

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?

Copy link
Collaborator Author

@fungairino fungairino Oct 10, 2024

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

Copy link

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.

@fungairino fungairino merged commit bf34e41 into main Oct 10, 2024
20 checks passed
@fungairino fungairino deleted the 9193-fix-flaky-playwright-tests branch October 10, 2024 20:36
@twschiller twschiller added this to the 2.1.5 milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Fix flaky Playwright Tests
3 participants