-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename fuzz to convention #48
Conversation
LCOV of commit
|
LCOV of commit
|
@@ -160,7 +160,7 @@ jobs: | |||
|
|||
- name: Run Forge snapshot | |||
run: | | |||
forge snapshot --check gas-snapshots/${{ matrix.product }}.gas-snapshot | |||
forge snapshot --no-match-test testFuzz_ --check gas-snapshots/${{ matrix.product }}.gas-snapshot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try to not edit CI to hide failures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The snapshot results are like:
MerkleMultiProofTest:testMerkleMulti1of4(bytes32,bytes32,bytes32) (runs: 256, μ: 7037, ~: 7036)
MerkleMultiProofTest:testMerkleMulti2of4(bytes32,bytes32,bytes32,bytes32) (runs: 256, μ: 8714, ~: 8719)
MerkleMultiProofTest:testMerkleMulti3of4(bytes32,bytes32,bytes32,bytes32) (runs: 256, μ: 8795, ~: 8792)
MerkleMultiProofTest:testMerkleMulti4of4(bytes32,bytes32,bytes32,bytes32) (runs: 256, μ: 8772, ~: 8768)
With as much info I can find, these values can be flaky. It would make sense to exclude these tests from snapshot.
foundry-rs/foundry#1081
foundry-rs/foundry#4517
foundry-rs/foundry#5262
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussion and further investigation, latest foundry snapshot command does use a static seed, which should lead to deterministic inputs and overall consistent fuzz snapshot results.
This is not true, it only shows gas |
LCOV of commit
|
LCOV of commit
|
LCOV of commit
|
LCOV of commit
|
LCOV of commit
|
LCOV of commit
|
LCOV of commit
|
Motivation
Fuzz tests show up in snapshot result with test execution time. It can often cause snapshot check failure during CI since execution time can vary between dev's local machine and test env.Solution
Name fuzz tests as
testFuzz_*
according to Foundry conventionSkip testFuzz_ in snapshot