-
Notifications
You must be signed in to change notification settings - Fork 6k
Started shutting down the sampler when it gets deleted #23012
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| void SamplingProfiler::Start() const { | ||
| SamplingProfiler::~SamplingProfiler() { | ||
| if (is_running_) { | ||
| Stop(); |
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 some tests? i.e. you can start and stop and start etc and check the scheduling of samples (even if you mock out the meaty parts). And check that destroying indeed stops.
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.
Man, what a doozy to test, specially since there wasn't any existing tests. Ok, added.
we'd just let it continue running after it's been deleted.
72bc1a2 to
fc7f3a7
Compare
|
This pull request is not suitable for automatic merging in its current state.
|
Description
Previously we'd just let it continue running after it's been deleted.
Related Issues
flutter/flutter#72107
Tests
I added the following tests:
Added test that makes sure that the sampler isn't issuing any tasks on the task runner after it has been deleted.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.Reviewer Checklist
Breaking Change
Did any tests fail when you ran them? Please read handling breaking changes.