-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Attempt to deflake TestFnCacheSanity #10250
Conversation
c2eaff6
to
898d494
Compare
Isn't this effectively just bumping the tolerance to 2? |
In a way, yes. I've never seen it fail with anything larger than 1.4-1.5, so I think it's not so much increasing the tolerance but making sure our "approximation" is a whole number. We could even round instead of truncate to may be a bit more accurate, but this isn't an exact science - it's an approximation which is bound to be flaky. |
We could just increase the delta in |
I agree with @espadolini on that. I think that increasing the timeout is more explicit than casting to int.
Maybe I misunderstood your comment, but casting or rounding doesn't really change the value. Casting "removes" the floating part from the number, but that doesn't change the nature of the problem. Too big value will fail the test and that value is related to execution time. If we want to make that test more reliable, I think we should leverage the fact that now we can use |
My thought here was that the test is not flaky because it is sometimes too slow, but because sometimes a rounding error on our calculation for "expected number of reads" pushes us slightly over the tolerance of 1, and there's no such thing as a fractional read. In any case, updated the tolerance to 2. |
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.
Been running 6 instances of the lib/cache
tests for about 15 minutes together with adding t.Parallel()
to every test, and I've had a single failure because of a 2.2
; plenty of failures when the threshold was 1
@rosstimothy can you have a look? |
512217b
to
c677f8b
Compare
c677f8b
to
02eea03
Compare
Increase tolerance on expected reads. This should prevent failures where due to our approximation, we estimate a fractional number of reads that exceed our tolerance of 1. Sample error: Max difference between 10.461059975 and 9 allowed is 1, but difference was 1.4610599749999995 Updates #9492
02eea03
to
b686665
Compare
Convert approxReads to an integer (by truncating) before comparing
to actual reads.
This should prevent failures where due to our approximation, we estimate
a fractional number of reads that exceed our tolerance of 1.
Sample error:
Max difference between 10.461059975 and 9 allowed is 1, but difference was 1.4610599749999995
Updates #9492