profiler: document/test that Start restarts the profiler #1805
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Document that Start will restart the profiler with the given configuration if
the profiler was already running. Add a test to lock in this behavior.
This PR also removes the TestStartStopIdempotent test. This test made no
assertions, and at any rate Start was not idempotent to begin with.
Motivation
Start will first stop the profiler if it is already running, and the
re-start it with the given configuration. This behavior is not
documented. It is also not tested--the current test suite passes if
Start is changed to return early when the profiler is already active.
It is possible that there are apps out there which rely on this behavior
(some of our internal apps do), and it would be a breaking change for
these apps to make Start do nothing if the profiler is already started.
Given that there isn't a strong reason to change the behavior otherwise,
we should document it and make sure it's actually tested.
Describe how to test/QA your changes
See the unit test.
Reviewer's Checklist
Triage
milestone is set.