Skip to content

Conversation

grandizzy
Copy link
Collaborator

@grandizzy grandizzy commented Aug 20, 2025

Motivation

  • closes Invariant tests intermittently failing in the Github CI with the latest stable release #11369
  • in v1.2.3 (with proptest runner), the test just stops if PROPTEST_MAX_LOCAL_REJECTS is reached and is not considered a failure - this doesn't perform all expected runs. In v1.3.0 proptest strategy will stop generate new values and it is reported as a failure
  • ensure sender address generated by strategy is always valid, so PROPTEST_MAX_LOCAL_REJECTS is never reached and all runs performed as expected

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@DaniPopes DaniPopes marked this pull request as draft August 21, 2025 07:49
@grandizzy grandizzy changed the title chore: expect proptest strategy to generate new tree fix(invariant): ensure strategy always generates valid sender Aug 21, 2025
@grandizzy grandizzy marked this pull request as ready for review August 21, 2025 10:20
@grandizzy grandizzy requested a review from zerosnacks August 21, 2025 10:20
.prop_filter("excluded sender", move |addr| !senders.excluded.contains(addr))
.prop_map(move |addr| {
let mut addr = addr.as_address().unwrap();
// Make sure the selected address is not in list of excluded senders.
Copy link
Member

@DaniPopes DaniPopes Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you link to this pr or issue saying we can't use filter()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added in 79e1341

@grandizzy grandizzy requested a review from DaniPopes August 21, 2025 10:45
@grandizzy grandizzy merged commit 599f5e0 into foundry-rs:master Aug 21, 2025
22 checks passed
@github-project-automation github-project-automation bot moved this to Done in Foundry Aug 21, 2025
@grandizzy grandizzy deleted the new-tree-expect branch August 21, 2025 12:04
grandizzy added a commit to grandizzy/foundry that referenced this pull request Aug 21, 2025
…y-rs#11370)

* fix(invariant): ensure strategy always generates valid sender

* Better comment
grandizzy added a commit that referenced this pull request Aug 21, 2025
…d sender (#11370) (#11394)

fix(invariant): ensure strategy always generates valid sender (#11370)

* fix(invariant): ensure strategy always generates valid sender

* Better comment
@grandizzy grandizzy self-assigned this Aug 25, 2025
@grandizzy grandizzy moved this from Done to Completed in Foundry Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

Invariant tests intermittently failing in the Github CI with the latest stable release
3 participants