24
24
requires_gevent = pytest .mark .skipif (gevent is None , reason = "gevent not enabled" )
25
25
26
26
27
- def get_client_options (use_top_level_profiler_mode ):
27
+ def get_client_options ():
28
28
def client_options (
29
29
mode = None , auto_start = None , profile_session_sample_rate = 1.0 , lifecycle = "manual"
30
30
):
31
- if use_top_level_profiler_mode :
32
- return {
33
- "profile_lifecycle" : lifecycle ,
34
- "profiler_mode" : mode ,
35
- "profile_session_sample_rate" : profile_session_sample_rate ,
36
- "_experiments" : {
37
- "continuous_profiling_auto_start" : auto_start ,
38
- },
39
- }
40
31
return {
41
32
"profile_lifecycle" : lifecycle ,
33
+ "profiler_mode" : mode ,
42
34
"profile_session_sample_rate" : profile_session_sample_rate ,
43
35
"_experiments" : {
44
36
"continuous_profiling_auto_start" : auto_start ,
45
- "continuous_profiling_mode" : mode ,
46
37
},
47
38
}
48
39
@@ -60,8 +51,7 @@ def client_options(
60
51
@pytest .mark .parametrize (
61
52
"make_options" ,
62
53
[
63
- pytest .param (get_client_options (True ), id = "non-experiment" ),
64
- pytest .param (get_client_options (False ), id = "experiment" ),
54
+ pytest .param (get_client_options ()),
65
55
],
66
56
)
67
57
def test_continuous_profiler_invalid_mode (mode , make_options , teardown_profiling ):
@@ -83,8 +73,7 @@ def test_continuous_profiler_invalid_mode(mode, make_options, teardown_profiling
83
73
@pytest .mark .parametrize (
84
74
"make_options" ,
85
75
[
86
- pytest .param (get_client_options (True ), id = "non-experiment" ),
87
- pytest .param (get_client_options (False ), id = "experiment" ),
76
+ pytest .param (get_client_options ()),
88
77
],
89
78
)
90
79
def test_continuous_profiler_valid_mode (mode , make_options , teardown_profiling ):
@@ -106,8 +95,7 @@ def test_continuous_profiler_valid_mode(mode, make_options, teardown_profiling):
106
95
@pytest .mark .parametrize (
107
96
"make_options" ,
108
97
[
109
- pytest .param (get_client_options (True ), id = "non-experiment" ),
110
- pytest .param (get_client_options (False ), id = "experiment" ),
98
+ pytest .param (get_client_options ()),
111
99
],
112
100
)
113
101
def test_continuous_profiler_setup_twice (mode , make_options , teardown_profiling ):
@@ -215,8 +203,7 @@ def assert_single_transaction_without_profile_chunks(envelopes):
215
203
@pytest .mark .parametrize (
216
204
"make_options" ,
217
205
[
218
- pytest .param (get_client_options (True ), id = "non-experiment" ),
219
- pytest .param (get_client_options (False ), id = "experiment" ),
206
+ pytest .param (get_client_options ()),
220
207
],
221
208
)
222
209
@mock .patch ("sentry_sdk.profiler.continuous_profiler.PROFILE_BUFFER_SECONDS" , 0.01 )
@@ -275,8 +262,7 @@ def test_continuous_profiler_auto_start_and_manual_stop(
275
262
@pytest .mark .parametrize (
276
263
"make_options" ,
277
264
[
278
- pytest .param (get_client_options (True ), id = "non-experiment" ),
279
- pytest .param (get_client_options (False ), id = "experiment" ),
265
+ pytest .param (get_client_options ()),
280
266
],
281
267
)
282
268
@mock .patch ("sentry_sdk.profiler.continuous_profiler.PROFILE_BUFFER_SECONDS" , 0.01 )
@@ -340,8 +326,7 @@ def test_continuous_profiler_manual_start_and_stop_sampled(
340
326
@pytest .mark .parametrize (
341
327
"make_options" ,
342
328
[
343
- pytest .param (get_client_options (True ), id = "non-experiment" ),
344
- pytest .param (get_client_options (False ), id = "experiment" ),
329
+ pytest .param (get_client_options ()),
345
330
],
346
331
)
347
332
def test_continuous_profiler_manual_start_and_stop_unsampled (
@@ -382,8 +367,7 @@ def test_continuous_profiler_manual_start_and_stop_unsampled(
382
367
@pytest .mark .parametrize (
383
368
"make_options" ,
384
369
[
385
- pytest .param (get_client_options (True ), id = "non-experiment" ),
386
- pytest .param (get_client_options (False ), id = "experiment" ),
370
+ pytest .param (get_client_options ()),
387
371
],
388
372
)
389
373
@mock .patch ("sentry_sdk.profiler.continuous_profiler.DEFAULT_SAMPLING_FREQUENCY" , 21 )
@@ -444,8 +428,7 @@ def test_continuous_profiler_auto_start_and_stop_sampled(
444
428
@pytest .mark .parametrize (
445
429
"make_options" ,
446
430
[
447
- pytest .param (get_client_options (True ), id = "non-experiment" ),
448
- pytest .param (get_client_options (False ), id = "experiment" ),
431
+ pytest .param (get_client_options ()),
449
432
],
450
433
)
451
434
@mock .patch ("sentry_sdk.profiler.continuous_profiler.PROFILE_BUFFER_SECONDS" , 0.01 )
@@ -493,8 +476,7 @@ def test_continuous_profiler_auto_start_and_stop_unsampled(
493
476
@pytest .mark .parametrize (
494
477
"make_options" ,
495
478
[
496
- pytest .param (get_client_options (True ), id = "non-experiment" ),
497
- pytest .param (get_client_options (False ), id = "experiment" ),
479
+ pytest .param (get_client_options ()),
498
480
],
499
481
)
500
482
def test_continuous_profiler_manual_start_and_stop_noop_when_using_trace_lifecyle (
0 commit comments