Some tests fail randomly. If it is hard to fix them for now, what about simply retrying them many times? In this way, we could save a lot of time to rebuild and rerun all tests if one of them fails.
Implementation
Add a new macro #[flaky_test]
, which catches errors and runs the test 5 times. Report the error only if all trials fail.