-
Notifications
You must be signed in to change notification settings - Fork 2k
forge test --rerun
should rerun failing fuzz test input
#8629
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Here is an example of this happening in CI: https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/60845/workflows/9d3cf6ec-3be1-4da1-98f8-30b786def971/jobs/2551903 |
@tynes does your CI use same cache dir for subsequent runs? The saved fuzz failure counterexample needs to be available in cache dir when rerun, pls see https://book.getfoundry.sh/forge/replay-testing#fuzz-tests-failures you can locally check this functionality by using a test contract like contract ContractTest is Test {
function testA() public {
require(true);
}
function testB() public {
require(true);
}
function testC(uint256 a) public {
require(a != 0);
}
} on the first
while the next one runs only the failed test with failed counterexample (runs is 0)
|
Thank you @grandizzy for the help! |
Component
Forge
Describe the feature you would like
I am currently experiencing a situation in which
forge test --rerun
does indeed rerun a failed test but the failed test is a fuzz test and it is not always capturing the failure in the fuzz test. Ideally the cached output for the failure should include the fuzz inputs that triggered the failure and those are specifically used as inputs during the call with--rerun
so that the failure trace can be inspected with-vvv
Additional context
No response
The text was updated successfully, but these errors were encountered: