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 flaky tests #186

Closed
andrecasal opened this issue Jun 15, 2023 · 8 comments
Closed

Fix flaky tests #186

andrecasal opened this issue Jun 15, 2023 · 8 comments

Comments

@andrecasal
Copy link
Contributor

andrecasal commented Jun 15, 2023

After fixing the flaky logout, the logout POST request is not canceled in the browser anymore, but it's still aborted on Playwright tests. This causes the test to be flaky.

//...
await page.getByRole('link', { name: user.name ?? user.username }).click()
await page.getByRole('menuitem', { name: /logout/i }).click()
await expect(page).toHaveURL(`/`) // 👈 This doesn't help

await page.goto('/login')
await expect(page).toHaveURL(`/login`)
//...

Screenshot 2023-06-15 at 11 02 35

@andrecasal
Copy link
Contributor Author

andrecasal commented Jun 15, 2023

Running npx playwright test passes most of the time, but sometimes fails:
Screenshot 2023-06-15 at 11 30 38

Playwright Test Report:
Screenshot 2023-06-15 at 11 31 57

@kentcdodds
Copy link
Member

The warning in the console and the error you're reporting do not seem to be related 🤔 Just because the request is cancelled doesn't mean the server isn't processing it. I'm not sure why you're seeing a timeout on the delete operation, but that shouldn't be affected by this warning you're seeing in the console.

@andrecasal
Copy link
Contributor Author

No, they are different tests. Yeah, I'm not sure either 🤔 I'll update the issue if this keeps bugging and possibly a solution.

@andrecasal
Copy link
Contributor Author

ba56bf2 still didn't fix it 🙂

@kentcdodds
Copy link
Member

Bummer. I've not personally experienced any flakiness with the tests, so I'm afraid I don't know how to help with this :(

@andrecasal
Copy link
Contributor Author

Yeah, they fail to load routes sometimes, no idea why...

Two tests, one minute apart:
Screenshot 2023-06-29 at 11 52 30
Screenshot 2023-06-29 at 11 53 40

@kentcdodds
Copy link
Member

Sadly because I'm unable to reproduce I can't work on this myself

@kentcdodds
Copy link
Member

As I cannot reproduce, I am going to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants