FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-69134: Harden NotebookTest.test_traversal by serhiy-storchaka · Pull Request #153403 · python/cpython · GitHub

Repository navigation

gh-69134: Harden NotebookTest.test_traversal - #153403

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:harden-notebook-traversal
Jul 9, 2026
Merged

serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:harden-notebook-traversal

Conversation

serhiy-storchaka commented Jul 9, 2026 •
edited
Loading

Copy link
Copy Markdown
Member

Follow-up to GH-152499. NotebookTest.test_traversal wasn't covered there and still fails intermittently on a real X11 display: identify(5, 5) runs before the notebook reaches its requested size, so the pixel lands outside the first tab and returns '' instead of 'padding'.

wait_until_mapped() gains an opt-in full_size flag that also waits until the realized size reaches the requested size; both identify(5, 5) assertions now use it. The default path is unchanged, so the other callers are unaffected.

The flake doesn't reproduce when test_traversal runs alone (0/40), but running the whole NotebookTest class reliably reproduces it, since the earlier methods leave the shared class root in a state where the notebook maps too small. Measured on a real X11 display: 14/15 failures without the fix, 0/20 with it (and no other assertion starts failing).

identify(5, 5) could run before the notebook reached its requested size,
so the pixel fell outside the first tab and returned ''.  Guard it with a
new opt-in wait_until_mapped(full_size=True).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copy link
Copy Markdown
Member Author

Reproduction data (real X11 display):

  • test_traversal alone ×40 — 0 failures (does not reproduce in isolation).
  • whole NotebookTest class ×15 — 14 failures (~93%); the earlier methods leave the shared class root in a state where the notebook maps too small, so identify(5, 5) lands outside the first tab.
  • with this patch, NotebookTest class ×20 — 0 test_traversal failures and 0 other failures.

serhiy-storchaka enabled auto-merge (squash) July 9, 2026 09:40
serhiy-storchaka merged commit 53b0498 into python:main Jul 9, 2026
60 checks passed

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 53b04980284b668c27fc6d5adb0de19d38efe95b 3.13

bedevere-app Bot commented Jul 9, 2026

Copy link
Copy Markdown

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

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

bedevere-app Bot commented Jul 9, 2026

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 9, 2026
serhiy-storchaka added a commit that referenced this pull request Jul 9, 2026
…53409)

identify(5, 5) could run before the notebook reached its requested size,
so the pixel fell outside the first tab and returned ''.  Guard it with a
new opt-in wait_until_mapped(full_size=True).
(cherry picked from commit 53b0498)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
serhiy-storchaka added a commit that referenced this pull request Jul 9, 2026
…53408)

identify(5, 5) could run before the notebook reached its requested size,
so the pixel fell outside the first tab and returned ''.  Guard it with a
new opt-in wait_until_mapped(full_size=True).
(cherry picked from commit 53b0498)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

bedevere-app Bot commented Jul 9, 2026

Copy link
Copy Markdown

GH-153415 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jul 9, 2026
serhiy-storchaka deleted the harden-notebook-traversal branch July 9, 2026 11:08
serhiy-storchaka added a commit that referenced this pull request Jul 10, 2026
…53415)

identify(5, 5) could run before the notebook reached its requested size,
so the pixel fell outside the first tab and returned ''.  Guard it with a
new opt-in wait_until_mapped(full_size=True).
(cherry picked from commit 53b0498)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
serhiy-storchaka removed their assignment Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL