Skip to content
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

profiler: make TestSetProfileFraction more isolated #1281

Merged
merged 2 commits into from May 5, 2022

Conversation

nsrip-dd
Copy link
Contributor

@nsrip-dd nsrip-dd commented May 4, 2022

TestAllUploaded starts the mutex profiler. Currently the profiler
doesn't re-set the profile rate when Stop is called. This causes
TestSetProfileFraction/on to fail if it's run after TestAllUploaded
since the test checks that the old rate is different than the new rate,
but in both cases the rates are the default rate.

This commit changes the test to start by setting the rate to 0 and then
checking that it's either the default value or still 0 after starting
the profiler. This makes the test more isolated and not influenced by
what other tests do to the mutex profile fraction.

Fixes #1279

TestAllUploaded starts the mutex profiler. Currently the profiler
doesn't re-set the profile rate when Stop is called. This causes
TestSetProfileFraction/on to fail if it's run after TestAllUploaded
since the test checks that the old rate is different than the new rate,
but in both cases the rates are the default rate.

This commit changes the test to start by setting the rate to 0 and then
checking that it's either the default value or still 0 after starting
the profiler. This makes the test more isolated and not influenced by
what other tests do to the mutex profile fraction.

Fixes #1279
@nsrip-dd nsrip-dd requested a review from a team as a code owner May 4, 2022 17:54
@nsrip-dd nsrip-dd added this to the 1.39.0 milestone May 4, 2022
Copy link
Member

@felixge felixge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@felixge felixge merged commit 1c53df5 into v1 May 5, 2022
@felixge felixge deleted the nick.ripley/profiler-fix-set-fraction-test branch May 5, 2022 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

profiler: TestSetProfileFraction fails when run multiple times
2 participants