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

test: speed up some profiling tests #3134

Merged
merged 3 commits into from
Jul 7, 2023

Conversation

armcknight
Copy link
Member

@armcknight armcknight commented Jul 7, 2023

After looking at the list of 20 slowest tests for a recent CI run, I realized some of the sleeps in profiler tests are unnecessary, and others are unnecessarily long.

#skip-changelog

@armcknight armcknight changed the title extract implementation of SentryProfilerState; extract SentrySample test: speed up some profiling tests Jul 7, 2023
@armcknight armcknight force-pushed the armcknight/test/speed-up-profiling-tests branch from 5cfe118 to b4c6629 Compare July 7, 2023 06:23
@codecov
Copy link

codecov bot commented Jul 7, 2023

Codecov Report

Merging #3134 (b4c6629) into main (6c31077) will decrease coverage by 0.034%.
The diff coverage is 75.000%.

❗ Current head b4c6629 differs from pull request most recent head 5f9de8d. Consider uploading reports for the commit 5f9de8d to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #3134       +/-   ##
=============================================
- Coverage   89.125%   89.092%   -0.034%     
=============================================
  Files          500       499        -1     
  Lines        53963     53613      -350     
  Branches     19321     18987      -334     
=============================================
- Hits         48095     47765      -330     
- Misses        4900      4991       +91     
+ Partials       968       857      -111     
Impacted Files Coverage Δ
Tests/SentryProfilerTests/SentryBacktraceTests.mm 94.805% <0.000%> (-2.598%) ⬇️
...tryProfilerTests/SentryThreadMetadataCacheTests.mm 94.805% <ø> (ø)
...SentryProfilerTests/SentrySamplingProfilerTests.mm 89.473% <100.000%> (ø)

... and 84 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c31077...5f9de8d. Read the comment docs.

@@ -47,8 +47,6 @@ - (void)testRetrievesThreadMetadata
SENTRY_PROF_LOG_ERROR_RETURN(pthread_setschedparam(thread, policy, &param));
}

std::this_thread::sleep_for(std::chrono::seconds(1));
Copy link
Member

Choose a reason for hiding this comment

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

m: One CI job failed https://github.com/getsentry/sentry-cocoa/actions/runs/5483653476/jobs/9990243216?pr=3134 after removing the sleeps. Maybe we still need them.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah looks like it! just much shorter than 1 second

@armcknight armcknight merged commit 596ccc1 into main Jul 7, 2023
@armcknight armcknight deleted the armcknight/test/speed-up-profiling-tests branch July 7, 2023 19:44
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.

3 participants