https://github.com/python/cpython/commit/f2ad76f95d3c91d94e2383b1b7a1360944f5163a
commit: f2ad76f95d3c91d94e2383b1b7a1360944f5163a
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2026-11-09T17:05:53Z
summary:

[3.15] gh-160334: Accept special frames in collapsed profiling test (GH-161515) 
(#161686)

gh-160334: Accept special frames in collapsed profiling test (GH-161515)
(cherry picked from commit cb2eeed01697bb1a6b29e6dc582e7b172d158b1e)

Co-authored-by: Doremon <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>

files:
A Misc/NEWS.d/next/Tests/2026-11-07-01-45-00.gh-issue-160334.F2n8qA.rst
M Lib/test/test_profiling/test_sampling_profiler/test_integration.py

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 3487647b76683e..0b9d55bacc6659 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 <GC> and <unreadable frame>,
+                        # 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 00000000000000..458f192ce0be77
--- /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.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to