From 2953b5d06b93dc2ae53dc08b0045d4755b789817 Mon Sep 17 00:00:00 2001 From: Doremon <113814705+raman118@users.noreply.github.com> Date: Mon, 9 Nov 2026 21:56:56 +0530 Subject: [PATCH] gh-160334: Accept special frames in collapsed profiling test (GH-161515) (cherry picked from commit cb2eeed01697bb1a6b29e6dc582e7b172d158b1e) Co-authored-by: Doremon <113814705+raman118@users.noreply.github.com> Co-authored-by: Victor Stinner --- .../test_sampling_profiler/test_integration.py | 5 ++++- .../Tests/2026-11-07-01-45-00.gh-issue-160334.F2n8qA.rst | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Tests/2026-11-07-01-45-00.gh-issue-160334.F2n8qA.rst diff --git a/Lib/test/test_profiling/test_sampling_profiler/test_integration.py b/Lib/test/test_profiling/test_sampling_profiler/test_integration.py index 3487647b76683ee..0b9d55bacc6659c 100644 --- a/Lib/test/test_profiling/test_sampling_profiler/test_integration.py +++ b/Lib/test/test_profiling/test_sampling_profiler/test_integration.py @@ -508,7 +508,10 @@ def test_sampling_with_collapsed_export(self): if ";" in stack_trace: stack_parts = stack_trace.split(";") for part in stack_parts: - # Each part should be file:function:line + # Special frames, such as and , + # do not have file and line information. + if part.startswith("<") and part.endswith(">"): + continue self.assertIn(":", part) def test_sampling_all_threads(self): diff --git a/Misc/NEWS.d/next/Tests/2026-11-07-01-45-00.gh-issue-160334.F2n8qA.rst b/Misc/NEWS.d/next/Tests/2026-11-07-01-45-00.gh-issue-160334.F2n8qA.rst new file mode 100644 index 000000000000000..458f192ce0be77d --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-11-07-01-45-00.gh-issue-160334.F2n8qA.rst @@ -0,0 +1,2 @@ +Fix the sampling profiler integration test for special frames without file and +line information.