In some cases, I would need to retry a test only under some circumstances known at runtime. For example:
- Retry only on a specific exception or test failure message.
- Retry only in some JDK vendors.
I would expect the interface to be something like:
@Flaky(condition = { some closure here })
or perhaps something throwing a specific exception in the test:
flaky {
// some assertion that may be flaky, and the test can be retried if this one failed
}