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

dev: identifying flaky tests? #5195

Closed
mrienstra opened this issue Oct 26, 2022 · 1 comment
Closed

dev: identifying flaky tests? #5195

mrienstra opened this issue Oct 26, 2022 · 1 comment

Comments

@mrienstra
Copy link
Contributor

mrienstra commented Oct 26, 2022

I noticed some tests:
packages/create-astro/test/typescript-step.test.js#L37-L83
(which I feel somewhat responsible for, since I added them)
... seem to be flaky. I first noticed them failing in this PR:
https://github.com/withastro/astro/actions/runs/3316348321/jobs/5478061799
And then again today in this PR:
https://github.com/withastro/astro/actions/runs/3324584748/jobs/5496363068

I've seen other failing tests recently that didn't seem to be related to the PR, I can dig some other examples up later, or if anyone else knows of some off hand, please chime in.

Anyway -- putting aside for the moment that I need to fix those tests -- it would be great to have some way of analyzing test failures and spotting patterns. Or maybe that already exists for the Astro repo and I'm just not aware of it. So opening this issue to see what others think.

I skimmed a few articles on the subject:

CircleCI can detect flaky tests and offers free credits for open source, but that might be overkill.

Kiwi TCMS also looks like overkill, but maybe there's any easy way to just use it for testing telemetry...?

retries can be helpful for flaky tests: Mocha docs for retries. WebdriverIO has a nice summary. (Astro already retries Playwright tests 3 times in CI, 5 times in packages/integrations/prefetch) Not recommended for unit tests, but the packages/create-astro tests I mentioned are an example of tests that are kind of in between unit tests & e2e tests, maaaybe some of the other flaky test also fall into this category.

Found this package:

  • Dylanlan/mocha-bad-test-finder: I'll give it a whirl locally. Seems similar to something I've done before while debugging flaky Playwright tests. Wouldn't help with capturing & analyzing failures in CI.
@matthewp
Copy link
Contributor

We have a few. I have a list on Discord (I'll move to the #dev channel and ping you). Would love to continue the discussion there if possible. My opinion is that there are only 2 or 3 of these that cause false-positives in PRs and we should just skip or remove them. Happy to continue the discussion on discord.

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