Skip to content

Fix flakiness with WipeMyCal test#5454

Merged
kodiakhq[bot] merged 1 commit into
mainfrom
fix/flaky-test-wipemycal
Nov 10, 2022
Merged

Fix flakiness with WipeMyCal test#5454
kodiakhq[bot] merged 1 commit into
mainfrom
fix/flaky-test-wipemycal

Conversation

@hariombalhara
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara requested review from a team, emrysal and zomars November 10, 2022 05:28
@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 10, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Nov 10, 2022 at 5:35AM (UTC)

@what-the-diff
Copy link
Copy Markdown

what-the-diff Bot commented Nov 10, 2022

  • Changed expect to be a function call instead of an await
  • Added comment about why we don't want to wait for the mutation observer in this case
  • Removed unnecessary await from $openBookings assignment, since it's not used asynchronously anywhere else in the test file (and is only assigned once)


const $openBookingCount = await page.locator('[data-testid="bookings"] > *').count();
await expect($openBookingCount).toBe(3);
expect($openBookingCount).toBe(3);
Copy link
Copy Markdown
Member Author

@hariombalhara hariombalhara Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect doesn't return promise here

const $openBookings = await page.locator('[data-testid="bookings"]');
// Don't await send_request click, otherwise mutation can possibly occur before observer is attached
page.locator("data-testid=send_request").click();
const $openBookings = page.locator('[data-testid="bookings"]');
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

page.locator() doesnt return promise

@kodiakhq kodiakhq Bot merged commit 8416b76 into main Nov 10, 2022
@kodiakhq kodiakhq Bot deleted the fix/flaky-test-wipemycal branch November 10, 2022 07:45
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge ♻️ autoupdate tells kodiak to keep this branch up-to-date core area: core, team members only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants