Skip to content

fix(test): avoid 4 GB list allocation in BigTIFF threshold test#1808

Merged
brendancol merged 1 commit into
mainfrom
fix-bigtiff-test-oom-1785
May 13, 2026
Merged

fix(test): avoid 4 GB list allocation in BigTIFF threshold test#1808
brendancol merged 1 commit into
mainfrom
fix-bigtiff-test-oom-1785

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

CI on main has been failing since PR #1787 merged. The newly added
test_large_strip_table_alone_can_promote allocated a Python list of
(UINT32_MAX // 8) + 1 (~536 M) zeros before _compute_classic_ifd_overhead
was even called. On GitHub-hosted ubuntu runners (~7 GB RAM) this
OOM-killed the pytest worker with exit code 143, and fail-fast cancelled
every other matrix job.

Fix

Drive the same "huge strip table alone forces BigTIFF" assertion through
the n_entries parameter of _should_use_bigtiff_streaming (8 bytes per
entry, no list allocation). The _compute_classic_ifd_overhead wiring
is already covered by test_overhead_pushes_just_under_threshold_over
and test_large_gdal_metadata_flips_decision.

Evidence

Before: xrspatial/tests/test_geotiff_streaming_bigtiff_threshold_1785.py ....
then ##[error]Process completed with exit code 143. (run 25807252057).

After (local):

10 passed in 0.23s

Test plan

  • Whole file runs in 0.23s locally
  • Full pytest matrix on this branch passes in CI

test_large_strip_table_alone_can_promote built a tag list with
``[0] * (UINT32_MAX // 8 + 1)``, allocating roughly 4 GB before
``_compute_classic_ifd_overhead`` was even called. On GitHub-hosted
ubuntu runners (~7 GB RAM) this OOM-killed the pytest worker with
exit code 143, which fail-fast then cancelled the whole pytest job
on main.

Drive the same "huge strip table alone forces BigTIFF" assertion
through the ``n_entries`` parameter of ``_should_use_bigtiff_streaming``
(8 bytes per entry, no list allocation). The
``_compute_classic_ifd_overhead`` wiring is already exercised by
``test_overhead_pushes_just_under_threshold_over`` and
``test_large_gdal_metadata_flips_decision``.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 13, 2026
@brendancol brendancol merged commit 32be70e into main May 13, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant