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

flaky tests #23

Open
rosesyrett opened this issue Oct 4, 2023 · 9 comments
Open

flaky tests #23

rosesyrett opened this issue Oct 4, 2023 · 9 comments
Labels
bug Something isn't working github_actions Pull requests that update GitHub Actions code

Comments

@rosesyrett
Copy link
Collaborator

rosesyrett commented Oct 4, 2023

Sometimes CI tests fail. Flaky tests are bad and we should aim to not have any. Here is an example of such a test failing on one instance, but passing when rerun:

https://github.com/bluesky/ophyd-async/actions/runs/10741400139/job/29791703029
FAILED tests/epics/adsimdetector/test_sim.py::test_detector_writes_to_file - bluesky.utils.FailedStatus: <AsyncStatus, task: <coroutine object StandardDetector.trigger at 0x7fecaa70fe60>, errored: TimeoutError()>

@rosesyrett rosesyrett added the bug Something isn't working label Oct 4, 2023
@callumforrester
Copy link
Contributor

I haven't seen flaky tests for several months so going to close this. If they come back, I've wondered about detecting them with infrequent use of pytest-repeat

@DiamondJoseph
Copy link
Contributor

Flaky tests have re-appeared, I'm going to re-open this ticket.

@DiamondJoseph DiamondJoseph reopened this Sep 10, 2024
@DiamondJoseph DiamondJoseph added the github_actions Pull requests that update GitHub Actions code label Sep 10, 2024
@DiamondJoseph
Copy link
Contributor

If you observe flaky tests, please add them as a comment on this issue.

@callumforrester
Copy link
Contributor

Github actions tool for finding flaky tests, may be worth a look: https://github.com/ctrf-io/github-actions-test-reporter-ctrf

@DiamondJoseph
Copy link
Contributor

DiamondJoseph commented Sep 11, 2024

pytest plugin for generating CTRF report for the above https://pypi.org/project/pytest-json-ctrf/

Do we want a table of all runs or just of runs on main/after PRs are merged?

@callumforrester
Copy link
Contributor

I think all runs, why not?

@DiamondJoseph
Copy link
Contributor

Identifying flaky tests vs. tests that were temporarily broken by unfinished PRs?

@DiamondJoseph
Copy link
Contributor

@callumforrester I've enabled on this draft PR (scroll down to summary section): it hasn't marked any tests as flaky yet, and doesn't provide any easier method of seeing what's flaky/broken.

@coretl for comment too

https://github.com/bluesky/ophyd-async/actions/runs/10809455998?pr=567

@coretl
Copy link
Collaborator

coretl commented Oct 14, 2024

Tango tests are apparently flaky because of Tango test infrastructure and there is nothing we can do to fix that. I suggest we report test failures on this ticket and make PRs that @pytest.mark.flaky(reruns=2) individual flaky tests until the CI is reliable again.

The first PR that does this needs to add pytest-rerunfailures to the dev dependencies to get the marker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working github_actions Pull requests that update GitHub Actions code
Projects
None yet
Development

No branches or pull requests

4 participants