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: fix TestStopLatency #1297

Merged
merged 2 commits into from
May 24, 2022
Merged

profiler: fix TestStopLatency #1297

merged 2 commits into from
May 24, 2022

Conversation

nsrip-dd
Copy link
Contributor

The timeout for the test was not realistic given the constraints of the
Go runtime CPU profiler. Increase the timeout and add a second test case
meant to exercise the latency of both stopping the profiling as well as
stopping the profile upload.

Fixes #1294

The timeout for the test was not realistic given the constraints of the
Go runtime CPU profiler. Increase the timeout and add a second test case
meant to exercise the latency of both stopping the profiling as well as
stopping the profile upload.

Fixes #1294
@nsrip-dd nsrip-dd requested a review from a team as a code owner May 16, 2022 23:50
@nsrip-dd nsrip-dd added this to the 1.39.0 milestone May 16, 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.

Awesome! LGTM. Thanks 🙇

@felixge felixge merged commit b7bb9c2 into v1 May 24, 2022
@felixge felixge deleted the nick.ripley/fix-stop-latency-test branch May 24, 2022 09:45
@felixge
Copy link
Member

felixge commented May 24, 2022

Unfortunately the test is still flaky. See #1294 (comment) and #1306

@nsrip-dd
Copy link
Contributor Author

nsrip-dd commented May 24, 2022

Is there any reasonable bound we can place on how long stopping the upload should take? Moved to issue comments

nsrip-dd added a commit that referenced this pull request May 25, 2022
PR #1297 attempted to fix the flakiness noted in issue #1294 by creating
two seperate tests: one which runs a long profile to test the latency of
stopping the profile, and another which runs short profiles and makes
uploading hang indefinitely. However, the upload test had such a short
profiling period that the inner select statement in (*profiler).collect
could take several iterations to actually cancel due to the Go runtime
randomly choosing select cases when multiple cases are ready.

In addition, the "stop-profiler" case didn't actually test what it was
intended to test since profiling doesn't actually run until one full
profiling period has elapsed. Since the period was set to an hour, Stop
was called withouth profiling actually started.

Merge the two tests back into one. This brings us full-circle back to
the original test, but with a more generous window on how long stopping
should take and without relying on modifying internal functions to make
the test work.
nsrip-dd added a commit that referenced this pull request May 31, 2022
PR #1297 attempted to fix the flakiness noted in issue #1294 by creating
two seperate tests: one which runs a long profile to test the latency of
stopping the profile, and another which runs short profiles and makes
uploading hang indefinitely. However, the upload test had such a short
profiling period that the inner select statement in (*profiler).collect
could take several iterations to actually cancel due to the Go runtime
randomly choosing select cases when multiple cases are ready.

In addition, the "stop-profiler" case didn't actually test what it was
intended to test since profiling doesn't actually run until one full
profiling period has elapsed. Since the period was set to an hour, Stop
was called withouth profiling actually started.

Merge the two tests back into one. This brings us full-circle back to
the original test, but with a more generous window on how long stopping
should take and without relying on modifying internal functions to make
the test work.
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: TestStopLatency fails on nightly race detector tests
2 participants