Skip to content

gh-152260: Fix flaky curses test_scr_dump on macOS#152390

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:curses-scr-dump-test
Jun 27, 2026
Merged

gh-152260: Fix flaky curses test_scr_dump on macOS#152390
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:curses-scr-dump-test

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

The screen dump embeds raw pointers that change after scr_restore()
reallocates the virtual-screen structures, so comparing dump bytes is
unreliable on platforms such as macOS.

The previous attempt (gh-152260, PR #152340) tried to detect this by
comparing two consecutive dumps of the unchanged screen and only
byte-comparing when they matched. That probe is a false predictor: two
back-to-back dumps share the same live-allocation pointers, but the
asserted comparison is against a dump taken after scr_restore(), whose
pointers differ. So test_scr_dump stayed flaky-red on macos-26-intel.

Drop the byte comparison entirely and exercise the
scr_dump/scr_restore/scr_init/scr_set round-trip functionally.

The screen dump embeds raw pointers that change after scr_restore(),
so comparing dump bytes is unreliable.  Test the round-trip functionally
instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jun 27, 2026
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) June 27, 2026 11:35
@serhiy-storchaka serhiy-storchaka merged commit 3fa72d5 into python:main Jun 27, 2026
54 checks passed
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