Skip to content

gh-158574: Stabilize TLBC cache refresh tests - #158801

Merged
pablogsal merged 2 commits into
python:mainfrom
pablogsal:codex/fix-158574-tlbc-tests
Oct 5, 2026
Merged

pablogsal merged 2 commits into
python:mainfrom
pablogsal:codex/fix-158574-tlbc-tests

Conversation

@pablogsal

@pablogsal pablogsal commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Fixes #158574.

The TLBC cache refresh tests can sample a worker while it is returning from go.wait() and entering leaf(). Reading the thread state and stack at different times can produce an inconsistent frame snapshot, causing invalid memory reads or incorrect line numbers.

Have each worker notify a native SimpleQueue when it reaches its waiting function, then block in a native lock. The sampler waits for those notifications before reading the stacks. Both tests retain the same unwinder across phases and check the expected frames and source lines.

@pablogsal pablogsal added needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Oct 5, 2026
@pablogsal
pablogsal enabled auto-merge (squash) October 5, 2026 01:02
@pablogsal
pablogsal merged commit 0e75a05 into python:main Oct 5, 2026
52 checks passed
@pablogsal
pablogsal deleted the codex/fix-158574-tlbc-tests branch October 5, 2026 01:03
@miss-islington-app

Copy link
Copy Markdown

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @pablogsal, 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 0e75a0555731b9d7713d473e65b991f77316838c 3.14

@bedevere-app

bedevere-app Bot commented Oct 5, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Oct 5, 2026
@bedevere-app

bedevere-app Bot commented Oct 5, 2026

Copy link
Copy Markdown

GH-158818 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 5, 2026
pablogsal pushed a commit that referenced this pull request Oct 5, 2026
…8817)

Wait for workers to reach stable Python frames before sampling their stacks.
pablogsal added a commit that referenced this pull request Oct 5, 2026
…8818)

[3.14] gh-158574: Stabilize TLBC cache refresh tests (GH-158801)

Wait for workers to reach stable Python frames before sampling their stacks.
Adapt the backport to the 3.14 RemoteUnwinder API.

(cherry picked from commit 0e75a05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

1 participant