@@ -118,7 +118,7 @@ def read_ap_version(self: AsyncProfiledProcess) -> str:
118
118
return version
119
119
120
120
121
- def xtest_async_profiler_already_running (
121
+ def test_async_profiler_already_running (
122
122
application_pid : int ,
123
123
profiler_state : ProfilerState ,
124
124
assert_collapsed : AssertInCollapsed ,
@@ -163,7 +163,7 @@ def xtest_async_profiler_already_running(
163
163
164
164
165
165
@pytest .mark .parametrize ("in_container" , [True ])
166
- def xtest_java_async_profiler_cpu_mode (
166
+ def test_java_async_profiler_cpu_mode (
167
167
application_pid : int ,
168
168
assert_collapsed : AssertInCollapsed ,
169
169
profiler_state : ProfilerState ,
@@ -186,7 +186,7 @@ def xtest_java_async_profiler_cpu_mode(
186
186
187
187
@pytest .mark .parametrize ("in_container" , [True ])
188
188
@pytest .mark .parametrize ("application_image_tag" , ["musl" ])
189
- def xtest_java_async_profiler_musl_and_cpu (
189
+ def test_java_async_profiler_musl_and_cpu (
190
190
application_pid : int ,
191
191
assert_collapsed : AssertInCollapsed ,
192
192
profiler_state : ProfilerState ,
@@ -215,7 +215,7 @@ def test_java_safemode_parameters(profiler_state: ProfilerState) -> None:
215
215
assert "Java version checks are mandatory in --java-safemode" in str (excinfo .value )
216
216
217
217
218
- def xtest_java_safemode_version_check (
218
+ def test_java_safemode_version_check (
219
219
monkeypatch : MonkeyPatch ,
220
220
caplog : LogCaptureFixture ,
221
221
application_pid : int ,
@@ -226,6 +226,7 @@ def xtest_java_safemode_version_check(
226
226
monkeypatch .setitem (JavaProfiler .MINIMAL_SUPPORTED_VERSIONS , 8 , (Version ("8.999" ), 0 ))
227
227
228
228
with make_java_profiler (profiler_state ) as profiler :
229
+ profiler ._profiler_state .get_container_name (application_pid )
229
230
process = profiler ._select_processes_to_profile ()[0 ]
230
231
jvm_version_str = cast_away_optional (get_java_version (process , profiler ._profiler_state .stop_event ))
231
232
jvm_version = parse_jvm_version (jvm_version_str )
@@ -236,7 +237,7 @@ def xtest_java_safemode_version_check(
236
237
assert log_record_extra (log_record )["jvm_version" ] == repr (jvm_version )
237
238
238
239
239
- def xtest_java_safemode_build_number_check (
240
+ def test_java_safemode_build_number_check (
240
241
monkeypatch : MonkeyPatch ,
241
242
caplog : LogCaptureFixture ,
242
243
application_pid : int ,
@@ -245,6 +246,7 @@ def xtest_java_safemode_build_number_check(
245
246
profiler_state : ProfilerState ,
246
247
) -> None :
247
248
with make_java_profiler (profiler_state ) as profiler :
249
+ profiler ._profiler_state .get_container_name (application_pid )
248
250
process = profiler ._select_processes_to_profile ()[0 ]
249
251
jvm_version_str = cast_away_optional (get_java_version (process , profiler ._profiler_state .stop_event ))
250
252
jvm_version = parse_jvm_version (jvm_version_str )
@@ -261,10 +263,10 @@ def xtest_java_safemode_build_number_check(
261
263
[
262
264
(False , (), False ), # default
263
265
(False , ("-XX:ErrorFile=/tmp/my_custom_error_file.log" ,), False ), # custom error file
264
- # (True, (), False), # containerized (other params are ignored)
266
+ (True , (), False ), # containerized (other params are ignored)
265
267
],
266
268
)
267
- def xtest_hotspot_error_file (
269
+ def test_hotspot_error_file (
268
270
application_pid : int ,
269
271
monkeypatch : MonkeyPatch ,
270
272
caplog : LogCaptureFixture ,
@@ -297,7 +299,7 @@ def start_async_profiler_and_crash(self: AsyncProfiledProcess, *args: Any, **kwa
297
299
assert profiler ._safemode_disable_reason is not None
298
300
299
301
300
- def xtest_disable_java_profiling (
302
+ def test_disable_java_profiling (
301
303
application_pid : int ,
302
304
monkeypatch : MonkeyPatch ,
303
305
caplog : LogCaptureFixture ,
@@ -315,7 +317,7 @@ def xtest_disable_java_profiling(
315
317
assert "Java profiling has been disabled, skipping profiling of all java process" in caplog .text
316
318
317
319
318
- def xtest_already_loaded_async_profiler_profiling_failure (
320
+ def test_already_loaded_async_profiler_profiling_failure (
319
321
monkeypatch : MonkeyPatch ,
320
322
caplog : LogCaptureFixture ,
321
323
application_pid : int ,
@@ -339,7 +341,7 @@ def xtest_already_loaded_async_profiler_profiling_failure(
339
341
# test only once; and don't test in container - as it will go down once we kill the Java app.
340
342
@pytest .mark .parametrize ("in_container" , [False ])
341
343
@pytest .mark .parametrize ("check_app_exited" , [False ]) # we're killing it, the exit check will raise.
342
- def xtest_async_profiler_output_written_upon_jvm_exit (
344
+ def test_async_profiler_output_written_upon_jvm_exit (
343
345
tmp_path_world_accessible : Path ,
344
346
application_pid : int ,
345
347
assert_collapsed : AssertInCollapsed ,
@@ -367,7 +369,7 @@ def delayed_kill() -> None:
367
369
368
370
# test only once
369
371
@pytest .mark .parametrize ("in_container" , [False ])
370
- def xtest_async_profiler_stops_after_given_timeout (
372
+ def test_async_profiler_stops_after_given_timeout (
371
373
tmp_path_world_accessible : Path ,
372
374
application_pid : int ,
373
375
assert_collapsed : AssertInCollapsed ,
@@ -400,7 +402,7 @@ def xtest_async_profiler_stops_after_given_timeout(
400
402
401
403
@pytest .mark .parametrize ("in_container" , [True ])
402
404
@pytest .mark .parametrize ("application_image_tag,search_for" , [("j9" , "OpenJ9" ), ("zing" , "Zing" )])
403
- def xtest_sanity_other_jvms (
405
+ def test_sanity_other_jvms (
404
406
application_pid : int ,
405
407
assert_collapsed : AssertInCollapsed ,
406
408
search_for : str ,
@@ -417,6 +419,7 @@ def xtest_sanity_other_jvms(
417
419
frequency = 99 ,
418
420
java_async_profiler_mode = "cpu" ,
419
421
) as profiler :
422
+ profiler ._profiler_state .get_container_name (application_pid )
420
423
process = psutil .Process (application_pid )
421
424
assert search_for in cast_away_optional (get_java_version (process , profiler ._profiler_state .stop_event ))
422
425
process_collapsed = snapshot_pid_collapsed (profiler , application_pid )
@@ -425,7 +428,7 @@ def xtest_sanity_other_jvms(
425
428
426
429
@pytest .mark .parametrize ("in_container" , [True ])
427
430
@pytest .mark .parametrize ("application_image_tag,search_for" , [("eclipse-temurin-latest" , "Temurin" )])
428
- def xtest_sanity_latest_jvms (
431
+ def test_sanity_latest_jvms (
429
432
application_pid : int ,
430
433
assert_collapsed : AssertInCollapsed ,
431
434
search_for : str ,
@@ -438,6 +441,7 @@ def xtest_sanity_latest_jvms(
438
441
"""
439
442
440
443
with make_java_profiler (profiler_state ) as profiler :
444
+ profiler ._profiler_state .get_container_name (application_pid )
441
445
# sanity check that this is the correct JVM we're targeting
442
446
assert search_for in cast_away_optional (
443
447
get_java_version (psutil .Process (application_pid ), profiler ._profiler_state .stop_event )
@@ -462,7 +466,7 @@ def simulate_libjvm_delete(application_pid: int) -> None:
462
466
463
467
# test only once. in a container, so that we don't mess up the environment :)
464
468
@pytest .mark .parametrize ("in_container" , [True ])
465
- def xtest_java_deleted_libjvm (
469
+ def test_java_deleted_libjvm (
466
470
application_pid : int ,
467
471
application_docker_container : Container ,
468
472
assert_collapsed : AssertInCollapsed ,
@@ -501,7 +505,7 @@ def _filter_record(r: LogRecord) -> bool:
501
505
pytest .param ("ro" , [docker .types .Mount (target = "/tmpfs" , source = "" , type = "tmpfs" , read_only = True )], id = "ro" ),
502
506
],
503
507
)
504
- def xtest_java_noexec_or_ro_dirs (
508
+ def test_java_noexec_or_ro_dirs (
505
509
tmp_path_world_accessible : Path , # will be used by AP for logs & outputs
506
510
application_pid : int ,
507
511
extra_application_docker_mounts : List [docker .types .Mount ],
@@ -569,7 +573,7 @@ def xtest_java_noexec_or_ro_dirs(
569
573
570
574
571
575
@pytest .mark .parametrize ("in_container" , [True ])
572
- def xtest_java_symlinks_in_paths (
576
+ def test_java_symlinks_in_paths (
573
577
application_pid : int ,
574
578
application_docker_container : Container ,
575
579
assert_collapsed : AssertInCollapsed ,
@@ -616,7 +620,7 @@ def xtest_java_symlinks_in_paths(
616
620
617
621
618
622
@pytest .mark .parametrize ("in_container" , [True ]) # only in container is enough
619
- def xtest_java_appid_and_metadata_before_process_exits (
623
+ def test_java_appid_and_metadata_before_process_exits (
620
624
application_pid : int ,
621
625
assert_collapsed : AssertInCollapsed ,
622
626
monkeypatch : MonkeyPatch ,
@@ -657,7 +661,7 @@ def start_async_profiler_and_interrupt(self: AsyncProfiledProcess, *args: Any, *
657
661
658
662
659
663
@pytest .mark .parametrize ("in_container" , [True ]) # only in container is enough
660
- def xtest_java_attach_socket_missing (
664
+ def test_java_attach_socket_missing (
661
665
application_pid : int ,
662
666
profiler_state : ProfilerState ,
663
667
) -> None :
@@ -680,7 +684,7 @@ def xtest_java_attach_socket_missing(
680
684
681
685
# we know what messages to expect when in container, not on the host Java
682
686
@pytest .mark .parametrize ("in_container" , [True ])
683
- def xtest_java_jattach_async_profiler_log_output (
687
+ def test_java_jattach_async_profiler_log_output (
684
688
application_pid : int ,
685
689
caplog : LogCaptureFixture ,
686
690
profiler_state : ProfilerState ,
@@ -817,7 +821,7 @@ def test_non_java_basename_version(
817
821
818
822
@pytest .mark .parametrize ("in_container" , [True ])
819
823
@pytest .mark .parametrize ("insert_dso_name" , [False , True ])
820
- def xtest_dso_name_in_ap_profile (
824
+ def test_dso_name_in_ap_profile (
821
825
application_pid : int ,
822
826
insert_dso_name : bool ,
823
827
profiler_state : ProfilerState ,
@@ -836,7 +840,7 @@ def xtest_dso_name_in_ap_profile(
836
840
@pytest .mark .parametrize ("in_container" , [True ])
837
841
@pytest .mark .parametrize ("insert_dso_name" , [False , True ])
838
842
@pytest .mark .parametrize ("libc_pattern" , [r"(^|;)\(/.*/libc-.*\.so\)($|;)" ])
839
- def xtest_handling_missing_symbol_in_profile (
843
+ def test_handling_missing_symbol_in_profile (
840
844
application_pid : int ,
841
845
insert_dso_name : bool ,
842
846
libc_pattern : str ,
@@ -852,7 +856,7 @@ def xtest_handling_missing_symbol_in_profile(
852
856
853
857
854
858
@pytest .mark .parametrize ("in_container" , [True ])
855
- def xtest_meminfo_logged (
859
+ def test_meminfo_logged (
856
860
application_pid : int ,
857
861
caplog : LogCaptureFixture ,
858
862
profiler_state : ProfilerState ,
@@ -869,7 +873,7 @@ def xtest_meminfo_logged(
869
873
870
874
# test that java frames include no semicolon but use a pipe '|' character instead, as implemented by AP
871
875
@pytest .mark .parametrize ("in_container" , [True ])
872
- def xtest_java_frames_include_no_semicolons (
876
+ def test_java_frames_include_no_semicolons (
873
877
application_pid : int ,
874
878
profiler_state : ProfilerState ,
875
879
) -> None :
@@ -896,7 +900,7 @@ def xtest_java_frames_include_no_semicolons(
896
900
897
901
# test that async profiler doesn't print anything to applications stdout, stderr streams
898
902
@pytest .mark .parametrize ("in_container" , [True ])
899
- def xtest_no_stray_output_in_stdout_stderr (
903
+ def test_no_stray_output_in_stdout_stderr (
900
904
application_pid : int ,
901
905
application_docker_container : Container ,
902
906
monkeypatch : MonkeyPatch ,
@@ -1094,7 +1098,7 @@ def flush_output_and_stop_async_profiler(self: AsyncProfiledProcess, *args: Any,
1094
1098
),
1095
1099
],
1096
1100
)
1097
- def xtest_collect_default_jvm_flags (
1101
+ def test_collect_default_jvm_flags (
1098
1102
profiler_state : ProfilerState ,
1099
1103
tmp_path : Path ,
1100
1104
application_pid : int ,
@@ -1178,7 +1182,7 @@ def xtest_collect_default_jvm_flags(
1178
1182
),
1179
1183
],
1180
1184
)
1181
- def xtest_collect_cmdline_and_env_jvm_flags (
1185
+ def test_collect_cmdline_and_env_jvm_flags (
1182
1186
docker_client : DockerClient ,
1183
1187
application_docker_image : Image ,
1184
1188
assert_collapsed : AssertInCollapsed ,
@@ -1218,7 +1222,7 @@ def xtest_collect_cmdline_and_env_jvm_flags(
1218
1222
@pytest .mark .parametrize ("java_cli_flags" , ["-XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=95" ])
1219
1223
@pytest .mark .parametrize ("in_container" , [True ])
1220
1224
@pytest .mark .parametrize ("expected_flags" , [[]])
1221
- def xtest_collect_flags_unsupported_filtered_out (
1225
+ def test_collect_flags_unsupported_filtered_out (
1222
1226
docker_client : DockerClient ,
1223
1227
application_docker_image : Image ,
1224
1228
assert_collapsed : AssertInCollapsed ,
@@ -1246,10 +1250,9 @@ def xtest_collect_flags_unsupported_filtered_out(
1246
1250
f"exec java { java_cli_flags } -jar Fibonacci.jar" ,
1247
1251
],
1248
1252
) as container :
1249
- assert (
1250
- profiler ._metadata .get_jvm_flags_serialized (psutil .Process (container .attrs ["State" ]["Pid" ]))
1251
- == expected_flags
1252
- )
1253
+ pid = container .attrs ["State" ]["Pid" ]
1254
+ profiler ._profiler_state .get_container_name (pid )
1255
+ assert profiler ._metadata .get_jvm_flags_serialized (psutil .Process (pid )) == expected_flags
1253
1256
log_record = next (filter (lambda r : r .message == "Missing requested flags:" , caplog .records ))
1254
1257
# use slicing to remove the leading -XX: instead of removeprefix as it's not available in python 3.8
1255
1258
assert (
@@ -1260,7 +1263,7 @@ def xtest_collect_flags_unsupported_filtered_out(
1260
1263
1261
1264
@pytest .mark .parametrize ("in_container" , [True ])
1262
1265
@pytest .mark .parametrize ("expected_flags" , [[]])
1263
- def xtest_collect_none_jvm_flags (
1266
+ def test_collect_none_jvm_flags (
1264
1267
profiler_state : ProfilerState ,
1265
1268
tmp_path : Path ,
1266
1269
application_pid : int ,
@@ -1272,7 +1275,7 @@ def xtest_collect_none_jvm_flags(
1272
1275
1273
1276
@pytest .mark .parametrize ("in_container" , [True ])
1274
1277
@pytest .mark .parametrize ("include_mmm" , [True , False ])
1275
- def xtest_including_method_modifiers (
1278
+ def test_including_method_modifiers (
1276
1279
application_pid : int ,
1277
1280
profiler_state : ProfilerState ,
1278
1281
include_mmm : bool ,
@@ -1287,7 +1290,7 @@ def xtest_including_method_modifiers(
1287
1290
1288
1291
@pytest .mark .parametrize ("java_line_numbers" , ["none" , "line-of-function" ])
1289
1292
@pytest .mark .parametrize ("in_container" , [True ])
1290
- def xtest_including_line_numbers (
1293
+ def test_including_line_numbers (
1291
1294
application_pid : int ,
1292
1295
profiler_state : ProfilerState ,
1293
1296
java_line_numbers : str ,
0 commit comments