#flaky #re-run #flaky-testing #retry

fickle

Tools for handling fickle (flaky) tests in rust

4 releases (2 breaking)

0.3.0 Oct 2, 2024
0.2.1 Sep 30, 2024
0.2.0 Sep 30, 2024
0.1.0 Sep 29, 2024

#735 in Testing

Download history 224/week @ 2025-05-24 150/week @ 2025-05-31 195/week @ 2025-06-07 179/week @ 2025-06-14 202/week @ 2025-06-21 223/week @ 2025-06-28 186/week @ 2025-07-05 177/week @ 2025-07-12 184/week @ 2025-07-19 396/week @ 2025-07-26 641/week @ 2025-08-02 683/week @ 2025-08-09 663/week @ 2025-08-16 622/week @ 2025-08-23 509/week @ 2025-08-30 364/week @ 2025-09-06

2,162 downloads per month
Used in 2 crates

GPL-3.0-only

20KB
360 lines

fickle

Handle fickle (flaky) tests in rust.

Usage

The primary api is to use the fickle macro attribute like this:

#[test]
#[fickle]
fn flaky_test() {
    // your test here
}

By default, it will re-run your test 1 time (if the first time fails). If you want to allow more than 1 retry you can specify that with the retries argument.

#[test]
#[fickle(retries=3)]
fn flakier_test() {
    // your test here
}

There is also the option of using the Fickle struct (which is what the macro expands to under the hood). This would look something like this

#[test]
fn flaky_test() {
    let fickle = fickle::Fickle::default();
    let block: fn() -> () = || {
        // your test here
    };
    fickle.run(block).unwrap();
}

Dependencies

~0.7–8.5MB
~63K SLoC