Skip to content

My Test for Stateful Fuzzing isn't catching the invariant #267

Closed Answered by djz-kagen
BlackAnon22 asked this question in Q&A
Discussion options

You must be logged in to vote

I ran into this today where the stateful fuzz test was passing. I know it was mentioned above with increasing runs but that is the answer. Either updates to foundry or my platform (WSL) causes the randomness to "change" even with the same seed as Patrick.

Update number of runs in foundry.toml for invariant.

[invariant]
- runs = 64
+ runs = 1000
depth = 32
fail_on_revert = false

It catches it on run 367 so 64 runs would miss it.

Encountered 1 failing test in test/invariant-break/StatefulFuzzCatchesTest.t.sol:StatefulFuzzCatchesTest
[FAIL: panic: assertion failed (0x01)]
        [Sequence]
                sender=0x0000000000000000000000000000000000000768 addr=[src/invariant-break/StatefulFu…

Replies: 3 comments 28 replies

Comment options

You must be logged in to vote
4 replies
@BlackAnon22
Comment options

@EngrPips
Comment options

@BlackAnon22
Comment options

@EngrPips
Comment options

Comment options

You must be logged in to vote
21 replies
@EngrPips
Comment options

@BlackAnon22
Comment options

@EngrPips
Comment options

@BlackAnon22
Comment options

@EngrPips
Comment options

Comment options

You must be logged in to vote
3 replies
@EngrPips
Comment options

@BlackAnon22
Comment options

@EngrPips
Comment options

Answer selected by BlackAnon22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants