-
Notifications
You must be signed in to change notification settings - Fork 207
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
Fix forge scheduled tests #3003
base: master
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess one thing we are losing with these changes is that we no longer assert if the max steps is sufficiently close to the default of 10m. Maybe with some logic changes we could still retain this check? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or we could hide this check behind a feature as well, what do you think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has already been changed a few times and it is unmaintainable. Unfortunately, I don't have any idea for a test that will have 10m steps and for sure remain unchanged with future Cairo versions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I modified those tests to get the following steps values:
It seems to be close enough to test the desired behavior (failing for >10m steps - tested in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, we can do that |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,7 @@ fn fuzzed_while_loop() { | |
|
||
// TODO (#2926) | ||
assert_eq!(gas_info.min, 2); | ||
assert_eq!(gas_info.max, 23); | ||
assert!(gas_info.max.abs_diff(23) <= 1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
assert!((gas_info.mean - 12.).abs() < f64::EPSILON); | ||
assert!((gas_info.std_deviation - 6.24).abs() < 0.01); | ||
assert!((gas_info.std_deviation - 6.24).abs() < 0.05); | ||
} |
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.
Can we add a different
assert_gas
method that uses diff and choose which one to use according to the feature? Then the scheduled tests on version other than scarb from.tool-version
could use it.E.g.
I'd prefer if we still kept exact gas assertions when developing code. I know difference of
1
is not that big but we should assert exact values here.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.
As discussed offline, for now leaving it as it is