You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently all the tests annotated with flaky_test are converted into #[test]. Would be great to have support for async test cases, probably by converting them into #[tokio::test].
The text was updated successfully, but these errors were encountered:
This adds support for `async` test cases by delegating to [`tokio::test`].
With this change, `flaky_test` macro can accept all arguments that [`tokio::test`] takes, and can be used together with `times = <int>` to change the max number of retries. So the most complex usage will look like:
```rust
#[flaky_test(times = 5, tokio(flavor = "multi_thread", worker_threads = 2))]
async fn mytest() {
// ...
}
```
It also has one breaking change. That is, in order to make the macro syntax extensible for future addition, the support for single integer literal like `#[flaky_test(5)]` is dropped in this commit. Users will need to replace this syntax with `#[flaky_test(times = 5)]`.
Closes#16
[`tokio::test`]: https://docs.rs/tokio/1.35.1/tokio/attr.test.html
Currently all the tests annotated with
flaky_test
are converted into#[test]
. Would be great to have support for async test cases, probably by converting them into#[tokio::test]
.The text was updated successfully, but these errors were encountered: