Skip to content

Test manifest cache size without reloading pyiceberg.manifest - #4517

Merged
Fokko merged 1 commit into
apache:mainfrom
moomindani:moomindani/manifest-cache-tests-without-reload
Nov 29, 2026
Merged

Fokko merged 1 commit into
apache:mainfrom
moomindani:moomindani/manifest-cache-tests-without-reload

Conversation

@moomindani

Copy link
Copy Markdown
Contributor

Rationale for this change

The manifest cache size tests in tests/utils/test_manifest.py call importlib.reload(pyiceberg.manifest) to pick up a new manifest-cache-size. A reload replaces the module's classes, so test modules that imported them earlier fail when they run afterwards. Running tests/utils/test_manifest.py and then tests/table/test_validate.py fails seven tests on main. CI doesn't hit it only because tests/table runs first.

The size is read when _ManifestCache is created, so the tests now build one directly and patch it in with monkeypatch, which also restores it.

Are these changes tested?

Yes, this is a test-only change. The nine cache tests pass, and running test_manifest.py before test_validate.py now passes (77 tests). If _ManifestCache ignores the configured size, the five size tests fail.

Are there any user-facing changes?

No.

This pull request and its description were written by Claude Code.

The cache size tests reloaded pyiceberg.manifest to pick up a new
configuration. A reload replaces the module's classes, so test modules
that imported them earlier, such as tests/table/test_validate.py, fail
when they run afterwards. Build a _ManifestCache directly and patch it
in with monkeypatch instead; the size is read when the cache is created.

Generated-by: Claude Code

@Fokko Fokko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable, thanks @moomindani for fixing this

@Fokko
Fokko added this pull request to the merge queue Nov 29, 2026
Merged via the queue into apache:main with commit 67447eb Nov 29, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants