Skip to content

gh-160334: Accept special frames in collapsed profiling test - #161515

Merged
vstinner merged 4 commits into
python:mainfrom
raman118:gh-160334-collapsed-unreadable-frame
Nov 9, 2026
Merged

vstinner merged 4 commits into
python:mainfrom
raman118:gh-160334-collapsed-unreadable-frame

Conversation

@raman118

@raman118 raman118 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Fixes gh-160334.

Collapsed profiling output uses bare special-frame names such as <GC> and <unreadable frame> when no file or line information is available. Update the integration test to accept that established format instead of requiring every stack part to contain a colon.

The current assertion fails deterministically for a collector fed an unreadable frame; the focused test and the full sampling-profiler integration module pass with this change.

Tests:

  • PCbuild\\build.bat -d -p x64 -M -q
  • PCbuild\\amd64\\python_d.exe -m test -v -m test_sampling_with_collapsed_export test_profiling.test_sampling_profiler.test_integration
  • PCbuild\\amd64\\python_d.exe -m test -v test_profiling.test_sampling_profiler.test_integration (21 passed, 1 skipped)
  • PCbuild\\amd64\\python_d.exe Tools\\patchcheck\\patchcheck.py

AI assistance was used to investigate the test failure and prepare this change. I reviewed the collector output and the test results before opening this PR.

@bedevere-app

bedevere-app Bot commented Nov 6, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@vstinner
vstinner enabled auto-merge (squash) November 9, 2026 15:50
@vstinner vstinner added the needs backport to 3.15 bugs and security fixes label Nov 9, 2026
@vstinner
vstinner merged commit cb2eeed into python:main Nov 9, 2026
55 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @raman118 for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Nov 9, 2026

Copy link
Copy Markdown

GH-161686 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Nov 9, 2026
@vstinner

vstinner commented Nov 9, 2026

Copy link
Copy Markdown
Member

Merged. Thanks for the fix.

@vstinner vstinner added the needs backport to 3.14 bugs and security fixes label Nov 9, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @raman118 for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @raman118 and @vstinner, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker cb2eeed01697bb1a6b29e6dc582e7b172d158b1e 3.14

@vstinner vstinner removed the needs backport to 3.14 bugs and security fixes label Nov 9, 2026
@vstinner

vstinner commented Nov 9, 2026

Copy link
Copy Markdown
Member

Lib/test/test_profiling/test_sampling_profiler/test_integration.py doesn't exist in the 3.14 branch: it's not impacted.

vstinner added a commit that referenced this pull request Nov 9, 2026
…H-161515) (#161686)

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

Co-authored-by: Doremon <113814705+raman118@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_sampling_with_collapsed_export fails when the profiler records an unreadable frame

2 participants