Analyze against using Stopwatches in the framework#137805
Analyze against using Stopwatches in the framework#137805Piinks wants to merge 1 commit intoflutter:masterfrom
Conversation
dev/bots/analyze.dart
Outdated
There was a problem hiding this comment.
Are we anticipating any legit reasons for opting out of this lint?
There was a problem hiding this comment.
Not sure yet, the analyzer just found a bunch for me to check out though!
There was a problem hiding this comment.
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.
@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.
SG. I'll try converting this to using the analyzer package once that PR is ready.
|
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.