Skip to content

Improve test stability - #9933

Merged
radarhere merged 3 commits into
python-pillow:mainfrom
akx:macos-pypy-failures
Sep 7, 2026
Merged

radarhere merged 3 commits into
python-pillow:mainfrom
akx:macos-pypy-failures

Conversation

@akx

@akx akx commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

This proposes to fix the PyPy CI flakiness by skipping or adjusting the tests that are observed to be flaky.

  • Leak test cases can't have accurate RSS measurements since PyPy may decide to JIT compile things during a test, and that'll remain in RSS. I linked Armin Rigo's, one of the PyPy head honchos', Stack Overflow comment as rationale.
  • test_empty_image allocated 100,000,000 64-bit ints for row pointers, in the "tall" case, which, I guess, would take a while when there's memory pressure (again, see above; PyPy is known to be memory-hungrier).

EDIT: Oh, the tall case also fails sometimes on vanilla macOS, e.g. here with "FAILED Tests/test_image.py::TestImage::test_empty_image[size0] - Failed: Timeout (>0.75s) from pytest-timeout." Making it allocate 10,000,000 ints instead of 100,000,000 should hopefully help, anyway.

@akx akx changed the title Don't run certain tests on PyPy Try to avoid PyPy test flakes Aug 31, 2026
@akx akx changed the title Try to avoid PyPy test flakes Try to avoid certain test flakes Sep 1, 2026
@radarhere

Copy link
Copy Markdown
Member

Regarding test_empty_image, see what you think of #9957

@akx akx mentioned this pull request Sep 4, 2026
@radarhere radarhere changed the title Try to avoid certain test flakes Improve test stability Sep 5, 2026
Comment thread Tests/helper.py Outdated
akx and others added 3 commits September 6, 2026 22:44
The tall case still needs to allocate the row-pointer table `im->image`, which is still roughly 700 megabytes, which evidently can be slow
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
@akx
akx force-pushed the macos-pypy-failures branch from 2a3079b to becd391 Compare September 6, 2026 19:44
@radarhere
radarhere merged commit d3b755d into python-pillow:main Sep 7, 2026
48 checks passed
@radarhere

Copy link
Copy Markdown
Member

test_empty_image has since been removed in #9958

@akx
akx deleted the macos-pypy-failures branch September 17, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants