11
11
get_profiler_id ,
12
12
setup_continuous_profiler ,
13
13
start_profiler ,
14
- start_profile_session ,
15
14
stop_profiler ,
16
- stop_profile_session ,
17
15
)
18
16
from tests .conftest import ApproxDict
19
17
@@ -209,21 +207,6 @@ def assert_single_transaction_without_profile_chunks(envelopes):
209
207
pytest .param ("gevent" , marks = requires_gevent ),
210
208
],
211
209
)
212
- @pytest .mark .parametrize (
213
- ["start_profiler_func" , "stop_profiler_func" ],
214
- [
215
- pytest .param (
216
- start_profile_session ,
217
- stop_profile_session ,
218
- id = "start_profile_session/stop_profile_session" ,
219
- ),
220
- pytest .param (
221
- start_profiler ,
222
- stop_profiler ,
223
- id = "start_profiler/stop_profiler (deprecated)" ,
224
- ),
225
- ],
226
- )
227
210
@pytest .mark .parametrize (
228
211
"make_options" ,
229
212
[
@@ -236,8 +219,6 @@ def test_continuous_profiler_auto_start_and_manual_stop(
236
219
sentry_init ,
237
220
capture_envelopes ,
238
221
mode ,
239
- start_profiler_func ,
240
- stop_profiler_func ,
241
222
make_options ,
242
223
teardown_profiling ,
243
224
):
@@ -258,7 +239,7 @@ def test_continuous_profiler_auto_start_and_manual_stop(
258
239
assert_single_transaction_with_profile_chunks (envelopes , thread )
259
240
260
241
for _ in range (3 ):
261
- stop_profiler_func ()
242
+ stop_profiler ()
262
243
263
244
envelopes .clear ()
264
245
@@ -268,7 +249,7 @@ def test_continuous_profiler_auto_start_and_manual_stop(
268
249
269
250
assert_single_transaction_without_profile_chunks (envelopes )
270
251
271
- start_profiler_func ()
252
+ start_profiler ()
272
253
273
254
envelopes .clear ()
274
255
@@ -286,21 +267,6 @@ def test_continuous_profiler_auto_start_and_manual_stop(
286
267
pytest .param ("gevent" , marks = requires_gevent ),
287
268
],
288
269
)
289
- @pytest .mark .parametrize (
290
- ["start_profiler_func" , "stop_profiler_func" ],
291
- [
292
- pytest .param (
293
- start_profile_session ,
294
- stop_profile_session ,
295
- id = "start_profile_session/stop_profile_session" ,
296
- ),
297
- pytest .param (
298
- start_profiler ,
299
- stop_profiler ,
300
- id = "start_profiler/stop_profiler (deprecated)" ,
301
- ),
302
- ],
303
- )
304
270
@pytest .mark .parametrize (
305
271
"make_options" ,
306
272
[
@@ -313,8 +279,6 @@ def test_continuous_profiler_manual_start_and_stop_sampled(
313
279
sentry_init ,
314
280
capture_envelopes ,
315
281
mode ,
316
- start_profiler_func ,
317
- stop_profiler_func ,
318
282
make_options ,
319
283
teardown_profiling ,
320
284
):
@@ -331,7 +295,7 @@ def test_continuous_profiler_manual_start_and_stop_sampled(
331
295
thread = threading .current_thread ()
332
296
333
297
for _ in range (3 ):
334
- start_profiler_func ()
298
+ start_profiler ()
335
299
336
300
envelopes .clear ()
337
301
@@ -345,7 +309,7 @@ def test_continuous_profiler_manual_start_and_stop_sampled(
345
309
346
310
assert get_profiler_id () is not None , "profiler should be running"
347
311
348
- stop_profiler_func ()
312
+ stop_profiler ()
349
313
350
314
# the profiler stops immediately in manual mode
351
315
assert get_profiler_id () is None , "profiler should not be running"
@@ -368,21 +332,6 @@ def test_continuous_profiler_manual_start_and_stop_sampled(
368
332
pytest .param ("gevent" , marks = requires_gevent ),
369
333
],
370
334
)
371
- @pytest .mark .parametrize (
372
- ["start_profiler_func" , "stop_profiler_func" ],
373
- [
374
- pytest .param (
375
- start_profile_session ,
376
- stop_profile_session ,
377
- id = "start_profile_session/stop_profile_session" ,
378
- ),
379
- pytest .param (
380
- start_profiler ,
381
- stop_profiler ,
382
- id = "start_profiler/stop_profiler (deprecated)" ,
383
- ),
384
- ],
385
- )
386
335
@pytest .mark .parametrize (
387
336
"make_options" ,
388
337
[
@@ -394,8 +343,6 @@ def test_continuous_profiler_manual_start_and_stop_unsampled(
394
343
sentry_init ,
395
344
capture_envelopes ,
396
345
mode ,
397
- start_profiler_func ,
398
- stop_profiler_func ,
399
346
make_options ,
400
347
teardown_profiling ,
401
348
):
@@ -409,15 +356,15 @@ def test_continuous_profiler_manual_start_and_stop_unsampled(
409
356
410
357
envelopes = capture_envelopes ()
411
358
412
- start_profiler_func ()
359
+ start_profiler ()
413
360
414
361
with sentry_sdk .start_span (name = "profiling" ):
415
362
with sentry_sdk .start_span (op = "op" ):
416
363
time .sleep (0.05 )
417
364
418
365
assert_single_transaction_without_profile_chunks (envelopes )
419
366
420
- stop_profiler_func ()
367
+ stop_profiler ()
421
368
422
369
423
370
@pytest .mark .parametrize (
@@ -538,21 +485,6 @@ def test_continuous_profiler_auto_start_and_stop_unsampled(
538
485
),
539
486
],
540
487
)
541
- @pytest .mark .parametrize (
542
- ["start_profiler_func" , "stop_profiler_func" ],
543
- [
544
- pytest .param (
545
- start_profile_session ,
546
- stop_profile_session ,
547
- id = "start_profile_session/stop_profile_session" ,
548
- ),
549
- pytest .param (
550
- start_profiler ,
551
- stop_profiler ,
552
- id = "start_profiler/stop_profiler (deprecated)" ,
553
- ),
554
- ],
555
- )
556
488
@pytest .mark .parametrize (
557
489
"make_options" ,
558
490
[
@@ -563,8 +495,6 @@ def test_continuous_profiler_auto_start_and_stop_unsampled(
563
495
def test_continuous_profiler_manual_start_and_stop_noop_when_using_trace_lifecyle (
564
496
sentry_init ,
565
497
mode ,
566
- start_profiler_func ,
567
- stop_profiler_func ,
568
498
class_name ,
569
499
make_options ,
570
500
teardown_profiling ,
@@ -580,11 +510,11 @@ def test_continuous_profiler_manual_start_and_stop_noop_when_using_trace_lifecyl
580
510
with mock .patch (
581
511
f"sentry_sdk.profiler.continuous_profiler.{ class_name } .ensure_running"
582
512
) as mock_ensure_running :
583
- start_profiler_func ()
513
+ start_profiler ()
584
514
mock_ensure_running .assert_not_called ()
585
515
586
516
with mock .patch (
587
517
f"sentry_sdk.profiler.continuous_profiler.{ class_name } .teardown"
588
518
) as mock_teardown :
589
- stop_profiler_func ()
519
+ stop_profiler ()
590
520
mock_teardown .assert_not_called ()
0 commit comments