feat: adds flaky

This commit is contained in:
nuno maduro
2026-04-10 19:52:31 +01:00
parent acd8aafa63
commit f528bd8427
11 changed files with 469 additions and 8 deletions

View File

@ -412,6 +412,20 @@ final class TestCall // @phpstan-ignore-line
return $this;
}
/**
* Marks the test as flaky, retrying it up to the given number of times.
*/
public function flaky(int $tries = 3): self
{
if ($tries < 1) {
throw new InvalidArgumentException('The number of tries must be greater than 0.');
}
$this->testCaseMethod->flakyTries = $tries;
return $this;
}
/**
* Marks the test as "todo".
*/