Skip to content
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

feat(proptest): update to suppress disabled shrink warnings #9972

Open
sambacha opened this issue Feb 27, 2025 · 2 comments
Open

feat(proptest): update to suppress disabled shrink warnings #9972

sambacha opened this issue Feb 27, 2025 · 2 comments
Labels
A-testing Area: testing T-feature Type: feature

Comments

@sambacha
Copy link
Contributor

Component

Forge

Describe the feature you would like

foundry.toml should let you set max_shrink_time and max_shrink_iters options

Currently you can do this via env setting by init:
PROPTEST_MAX_SHRINK_TIME and
PROPTEST_MAX_SHRINK_ITE

Additional context

running

forge test -vvvv --junit

Sometimes gives you the error:

proptest: Aborting shrinking after the PROPTEST_MAX_SHRINK_ITERS environment variable or ProptestConfig.max_shrink_iters iterations (set 0 to a large(r) value to shrink more; current configuration: 0 iterations)
proptest: Aborting shrinking after the PROPTEST_MAX_SHRINK_ITERS environment variable or ProptestConfig.max_shrink_iters iterations (set 0 to a large(r) value to shrink more; current configuration: 0 iterations)
proptest: Aborting shrinking after the PROPTEST_MAX_SHRINK_ITERS environment variable or ProptestConfig.max_shrink_iters iterations (set 0 to a large(r) value to shrink more; current configuration: 0 iterations)
proptest: Aborting shrinking after the PROPTEST_MAX_SHRINK_ITERS environment variable or ProptestConfig.max_shrink_iters iterations (set 0 to a large(r) value to shrink more; current configuration: 0 iterations)
@sambacha sambacha added T-feature Type: feature T-needs-triage Type: this issue needs to be labelled labels Feb 27, 2025
@github-project-automation github-project-automation bot moved this to Todo in Foundry Feb 27, 2025
@grandizzy
Copy link
Collaborator

Hey @sambacha thanks for reporting. we're not using proptest to shrink failures because

  • fuzz tests (stateless) produce a single counterexample, so nothing to shrink
  • invariant tests fuzzed inputs are single proptest runs which we loop in to the configured depth, so again nothing to be shrinked with proptest but through our custom code (can be configured with timeout and shrink run limit.
    Therefore we set proptest shrink iters to 0, basically disabling them, but proptest still gives warning. This should be fixed in proptest latest version with Verbosity of shrink disabled and persisted failure messages proptest-rs/proptest#459 so we need to update proptest to pick it up.

Going to track proptest update with this issue

@grandizzy grandizzy added A-testing Area: testing and removed T-needs-triage Type: this issue needs to be labelled labels Feb 27, 2025
@grandizzy grandizzy changed the title feat(proptest): expose max_shrink_time and max_shrink_iters as config options feat(proptest): update to suppress disabled shrink warnings Feb 27, 2025
@sambacha
Copy link
Contributor Author

Hey @sambacha thanks for reporting. we're not using proptest to shrink failures because

  • fuzz tests (stateless) produce a single counterexample, so nothing to shrink
  • invariant tests fuzzed inputs are single proptest runs which we loop in to the configured depth, so again nothing to be shrinked with proptest but through our custom code (can be configured with timeout and shrink run limit.
    Therefore we set proptest shrink iters to 0, basically disabling them, but proptest still gives warning. This should be fixed in proptest latest version with Verbosity of shrink disabled and persisted failure messages proptest-rs/proptest#459 so we need to update proptest to pick it up.

Going to track proptest update with this issue

makes sense, very weird this only shows up when using --junit flag, i checked and that seems to be the case.

thanks for the detailed report 🫡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing Area: testing T-feature Type: feature
Projects
Status: Todo
Development

No branches or pull requests

2 participants