Skip to content

tests: align VRT max_pixels tests with #1821 minimal-read semantics#1827

Merged
brendancol merged 1 commit into
mainfrom
fix-ci-main-vrt-tests
May 13, 2026
Merged

tests: align VRT max_pixels tests with #1821 minimal-read semantics#1827
brendancol merged 1 commit into
mainfrom
fix-ci-main-vrt-tests

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

CI on main has been failing since #1821 (#1704) merged. PR #1821 reads only the minimal SrcRect sub-rect that feeds the clipped destination sub-window for a SimpleSource that needs resampling. That PR updated test_vrt_dstrect_resample_cap_1737.py for the new semantics but missed two sibling tests asserting the old "full SrcRect rejected by max_pixels" behaviour:

  • test_vrt_source_max_pixels_1796.py::test_vrt_source_read_forwards_max_pixels
  • test_vrt_source_tile_check_1823.py::TestOutputWindowCheckStillEnforced::test_output_window_exceeds_max_pixels_still_rejected

Both expected ValueError matching "exceed" from a VRT that declared SrcRect 4x4 paired with DstRect 1x1 and max_pixels=1. Under the new path the source read shrinks to one pixel, the per-source cap and the output-window check no longer fire, and the read succeeds.

Changes

test_vrt_source_max_pixels_1796.py: rewritten to two tests.

  • test_tiny_vrt_with_huge_srcrect_now_reads_minimally asserts the new positive invariant (max_pixels=1 succeeds, returns 1 pixel).
  • test_source_cap_still_fires_when_sub_window_exceeds_budget asserts the per-source guard still bites when the sub-window itself crosses the budget.

test_vrt_source_tile_check_1823.py: TestOutputWindowCheckStillEnforced reframed to assert that an over-budget output extent is still rejected by _check_dimensions at the top of read_vrt. Module docstring updated to describe the post-#1821 contract.

Test plan

  • pytest xrspatial/geotiff/tests/test_vrt_source_max_pixels_1796.py xrspatial/geotiff/tests/test_vrt_source_tile_check_1823.py -v -- 6 passed
  • pytest xrspatial/geotiff/tests/ -k vrt -- 360 passed (one unrelated GPU-only pre-existing failure)

PR #1821 (#1704) made the VRT resample path read only the minimal
SrcRect sub-rect that maps to the clipped destination sub-window.
Test_vrt_dstrect_resample_cap_1737.py was updated in that PR but two
sibling tests asserting the old "full SrcRect rejected by max_pixels"
behaviour were missed and now fail in CI on main.

test_vrt_source_max_pixels_1796.py: the tiny-VRT-cannot-force-huge-
source-decode invariant is now structural (the source read is bounded
by the dst sub-window), so the test asserts the positive behaviour
(read succeeds, returns 1 pixel) plus a companion test that the
per-source cap still fires when the sub-window itself exceeds the
budget.

test_vrt_source_tile_check_1823.py: TestOutputWindowCheckStillEnforced
was checking the OUTPUT WINDOW CHECK with a 1x1 raster and a 4x4 SrcRect;
under #1821 the source read shrinks to one pixel and the check no longer
fires. Reframed the test to assert that an over-budget OUTPUT EXTENT
still rejects via _check_dimensions at the top of read_vrt.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 13, 2026
@brendancol brendancol merged commit 3ba8214 into main May 13, 2026
11 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