Skip to content

test: Assert presence of profile chunks after shutdown#6174

Merged
alexander-alderman-webb merged 2 commits into
masterfrom
webb/flaky-continuous-profiler-test-2
Apr 29, 2026
Merged

test: Assert presence of profile chunks after shutdown#6174
alexander-alderman-webb merged 2 commits into
masterfrom
webb/flaky-continuous-profiler-test-2

Conversation

@alexander-alderman-webb
Copy link
Copy Markdown
Contributor

@alexander-alderman-webb alexander-alderman-webb commented Apr 29, 2026

Description

Assert telemetry has been collected only after the continuous profiler shuts down. This removes the race where profiles had not yet reached the transport by the time the assertions ran.

According to the logs in the following failed run

https://github.com/getsentry/sentry-python/actions/runs/25110581685/job/73583219162

the test fails with the following stack trace:

_ test_continuous_profiler_manual_start_and_stop_sampled[non-experiment-start_profile_session/stop_profile_session  (deprecated)-thread] _
tests/profiler/test_continuous_profiler.py:362: in test_continuous_profiler_manual_start_and_stop_sampled
    assert_single_transaction_with_profile_chunks(envelopes, thread)
tests/profiler/test_continuous_profiler.py:147: in assert_single_transaction_with_profile_chunks
    assert len(items["profile_chunk"]) > 0
E   assert 0 > 0
E    +  where 0 = len([])

The stack trace shows that profiles were not collected in the test transport by the time the assertion is executed.

Issues

Reminders

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Codecov Results 📊

13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 8.53s

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 14904 uncovered lines.


Generated by Codecov Action

@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review April 29, 2026 14:48
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner April 29, 2026 14:48
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.

2 participants