Skip to content

Add a "retries" option to gpui::test macro and use it in flaky tests - #96

Merged
nathansobo merged 2 commits into
mainfrom
retry-flaky-tests
Jun 25, 2021
Merged

Add a "retries" option to gpui::test macro and use it in flaky tests#96
nathansobo merged 2 commits into
mainfrom
retry-flaky-tests

Conversation

@nathansobo

Copy link
Copy Markdown
Contributor

Closes #94
Closes #85
Closes #87
Closes #69

This is an experiment. Flaky tests have been a problem in almost every software project I've ever worked on. Any time you're testing async code, it's extremely difficult to nail down the timing of everything perfectly. There are always intermittent issues, and they often only occur on CI. It can be extremely time-consuming and demoralizing to try to track down every issue, but leaving tests flaky causes random build failures which is also bad.

The thought here is this: What if we accept that we're going to have some flaky tests and simply retry them. This lets us keep the tests in place without having to spend tons of time figuring out why they're flaky. This could be dangerous if we overuse it. Sometimes a flaky tests points to a real systemic problem. But I'd like us to have a means of choosing to take on debt related to these flaky tests rather than either deleting them or stopping everything to fix them immediately.

Now, if you want to add retry support to any tests, simply add a retries parameter to its test declaration:

#[gpui::test(retries = 5)]
async fn test_multiple_matches_with_same_relative_path(mut cx: gpui::TestAppContext) {

We'll see if this ends up being a bad idea.

@nathansobo
nathansobo merged commit c4729de into main Jun 25, 2021
@nathansobo
nathansobo deleted the retry-flaky-tests branch June 25, 2021 00:08
ascarter pushed a commit to ascarter/zed that referenced this pull request Jan 21, 2025
* Start adding docs for configurations and adapters

* Update debugger setting files with settings, attach config, & themes

I also ran prettier and typos on it too."

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…tests

Add a "retries" option to gpui::test macro and use it in flaky tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant