Part of #2286 (COG readiness/stability rollout).
Scope
Pin the HTTP/range COG reader's transport behavior with explicit byte and range-count assertions. Tests only — no production behavior changes unless a test surfaces a clear regression, in which case it should be filed as a separate issue rather than fixed in this PR.
Required changes
New file: xrspatial/geotiff/tests/test_http_cog_range_contract_2286.py.
Required assertions:
- Windowed reads fetch only intersecting tiles/strips. Spy on the HTTP layer; assert total bytes and range count are bounded by the windowed footprint, not the full file size.
- Overview reads fetch overview data, not full-res. A request for overview level N must not download the base IFD pixel data.
band= on multiband planar/interleaved COGs returns correct pixels and avoids unnecessary reads where possible. Compare against a rasterio reference; assert range count is bounded.
- Dask COG reads parse metadata once per graph, not once per chunk task. Count metadata range fetches across a multi-chunk compute and assert it is O(1) in chunk count.
- Truncated/malformed COGs close HTTP resources. Use a fault-injecting server or fixture that returns a malformed IFD or short body; assert that the session/connection is released and that the failure is a clear exception, not a hang.
- Coalescing is bounded and configurable. Assert
coalesce_ranges respects the configured max-merged-range size and that requests do not silently grow past it.
Reuse the HTTP fixture infrastructure from existing tests:
xrspatial/geotiff/tests/test_http_cog_coalesce.py
xrspatial/geotiff/tests/test_cog_http_parallel_decode_2026_05_15.py
xrspatial/geotiff/tests/test_http_range_validation_1735.py
xrspatial/geotiff/tests/test_cog_http_close_on_error_1816.py
xrspatial/geotiff/tests/test_http_window_band_planar_1669.py
xrspatial/geotiff/tests/test_http_stripped_window_max_pixels_issue_A_1842.py
Out of scope
- Fixing production regressions surfaced by these tests (file a separate issue).
- Redirect/private-host/security tests — those have their own coverage paths.
Acceptance
- New test file present.
- Each assertion above has at least one test row.
- Suite green on CPU CI; any row that surfaces a real bug is filed as a separate issue and marked xfail with the link.
Part of #2286 (COG readiness/stability rollout).
Scope
Pin the HTTP/range COG reader's transport behavior with explicit byte and range-count assertions. Tests only — no production behavior changes unless a test surfaces a clear regression, in which case it should be filed as a separate issue rather than fixed in this PR.
Required changes
New file:
xrspatial/geotiff/tests/test_http_cog_range_contract_2286.py.Required assertions:
band=on multiband planar/interleaved COGs returns correct pixels and avoids unnecessary reads where possible. Compare against a rasterio reference; assert range count is bounded.coalesce_rangesrespects the configured max-merged-range size and that requests do not silently grow past it.Reuse the HTTP fixture infrastructure from existing tests:
xrspatial/geotiff/tests/test_http_cog_coalesce.pyxrspatial/geotiff/tests/test_cog_http_parallel_decode_2026_05_15.pyxrspatial/geotiff/tests/test_http_range_validation_1735.pyxrspatial/geotiff/tests/test_cog_http_close_on_error_1816.pyxrspatial/geotiff/tests/test_http_window_band_planar_1669.pyxrspatial/geotiff/tests/test_http_stripped_window_max_pixels_issue_A_1842.pyOut of scope
Acceptance