-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Analyze against using Stopwatches in the framework #137805
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
dev/bots/analyze.dart
Outdated
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.
Are we anticipating any legit reasons for opting out of this lint?
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.
Not sure yet, the analyzer just found a bunch for me to check out though!
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.
I think that the blinking cursor uses a periodic Timer (or it should) since the tick rate is only once every hundred or so ms and the timer avoids pumping empty frames.
dev/bots/analyze.dart
Outdated
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.
@LongCatIsLooong was working on an analyzer-based way of detecting things like this instead of using somewhat error-prone string matching in https://github.com/flutter/flutter/pull/130101/files. This could be another great use case for that to exactly match on dart:core Stopwatch instantiations. Maybe we could extract the framework for these custom rules out of that PR and get the submitted without the more controversial debugAssert annotation so we could use it here as well?
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.
SG. I'll try converting this to using the analyzer package once that PR is ready.
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.
Awesome! Thank you @LongCatIsLooong!
|
Strange rebase. Sorry for extra pings! |
6b50757 to
4d43da8
Compare
|
Bah. Will just reopen another PR, I don't know what happened and the reflog is mocking me. 🤣 |
I faced a similar rebase issue in my very first pr for flutter/flutter. Workaround is to change the base branch to something else and then again back to master. |
Adds analysis to prevent Stopwatches from being reintroduced to the framework.
Fixes #137804
This is a follow up to #137381
It will prevent issues like #135728, where adding a stopwatch introduced a high number of flakes in the framework when it fell out of sync with the clock. This particular case affected every call to fling something in testing, which meant over 300 tests were suddenly very flaky. 😱
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.