-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Fix surface-size state leak in material/paginated_data_table_test (framework shuffle-all 3/n) #123842
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
Conversation
|
To check there weren't other ordering dependencies lurking in this file, I ran it with 100 different seeds. With only 18 tests in the file, an ordering-based flake would be expected to have a rate of at least 1/18 > 5.5%, so the data is enough to reject that with p<.004. |
|
@pdblasi-google Can you take a look at this one since you've been thinking already a bit about resetting test state to avoid leaks? |
|
This is good work, but I'd like to tackle this problem from another direction. For getting the no-shuffle off of the Thanks for bringing my attention to the If all instances of
|
|
@pdblasi-google OK, that plan makes sense to me. I'll rework this PR to just locally fix those tests using |
923dba0 to
b82ecc9
Compare
gnprice
left a comment
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.
Done; PTAL.
pdblasi-google
left a comment
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.
LGTM!
b82ecc9 to
0314ee9
Compare
…test (framework shuffle-all 3/n) (flutter/flutter#123842)
…amework shuffle-all 3/n) (flutter#123842) Fix surface-size state leak in material/paginated_data_table_test (framework shuffle-all 3/n)
…test (framework shuffle-all 3/n) (flutter/flutter#123842)
…test (framework shuffle-all 3/n) (flutter/flutter#123842)
Fixes part of #85160. This comes after #123751 and #123806 as part of removing
no-shuffletags from all tests in the framework.The tests in this file had a state leak because although many of them were scrupulously resetting the surface size, two tests were missing that step:
We could add a line
addTearDown(() => binding.setSurfaceSize(null));to those two tests. But it seems like we'll inevitably keep having bugs of this form — and so will any otherflutter_testusers that use thissetSurfaceSizefeature — unless the feature arranges to automatically either check that the state got reset, or just reset it.And then once we're automatically detecting that the state wasn't reset, it doesn't seem like there's anything to be gained by making the author of the individual test take care of it. This isn't a situation where there's any ambiguity about how to handle the reset, or where the un-reset data could be a sign of a broader bug; the thing the test author would do is always to just reset the state to the default anyway. So take care of it automatically.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.