Skip to content

Commit fa3e141

Browse files
test: Assert presence of profile chunks after shutdown
1 parent d58ac65 commit fa3e141

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

tests/profiler/test_continuous_profiler.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ def test_continuous_profiler_auto_start_and_manual_stop(
326326
pytest.param(get_client_options(False), id="experiment"),
327327
],
328328
)
329-
@mock.patch("sentry_sdk.profiler.continuous_profiler.PROFILE_BUFFER_SECONDS", 0.01)
330329
def test_continuous_profiler_manual_start_and_stop_sampled(
331330
sentry_init,
332331
capture_envelopes,
@@ -356,15 +355,15 @@ def test_continuous_profiler_manual_start_and_stop_sampled(
356355
with sentry_sdk.start_transaction(name="profiling"):
357356
assert get_profiler_id() is not None, "profiler should be running"
358357
with sentry_sdk.start_span(op="op"):
359-
time.sleep(0.1)
358+
pass
360359
assert get_profiler_id() is not None, "profiler should be running"
361360

362-
assert_single_transaction_with_profile_chunks(envelopes, thread)
363-
364361
assert get_profiler_id() is not None, "profiler should be running"
365362

366363
stop_profiler_func()
367364

365+
assert_single_transaction_with_profile_chunks(envelopes, thread)
366+
368367
# the profiler stops immediately in manual mode
369368
assert get_profiler_id() is None, "profiler should not be running"
370369

@@ -373,7 +372,7 @@ def test_continuous_profiler_manual_start_and_stop_sampled(
373372
with sentry_sdk.start_transaction(name="profiling"):
374373
assert get_profiler_id() is None, "profiler should not be running"
375374
with sentry_sdk.start_span(op="op"):
376-
time.sleep(0.1)
375+
pass
377376
assert get_profiler_id() is None, "profiler should not be running"
378377

379378
assert_single_transaction_without_profile_chunks(envelopes)

0 commit comments

Comments
 (0)