Repository navigation
Conversation
echoix
marked this pull request as ready for review
September 5, 2026 00:46
3 of 6 tasks
echoix
force-pushed
the
claude/raster2numpy-region-timing-fix
branch
from
September 5, 2026 02:59
80fc75c to
c4916ec
Compare
echoix
pushed a commit
that referenced
this pull request
Sep 5, 2026
Follow-up to #686: fixing the resource leak there turned a fatal, whole-file-crashing FERROR into three individually diagnosable failures instead. The remaining issue is real but distinct from the leak: the small region these tests set up isn't actually restricting what RasterRow reads back (rast[0] comes back with roughly 100000 elements instead of 10). Built GRASS locally and confirmed this is genuinely Windows-specific, not a state leak this environment can reproduce: the file passes reliably on Linux both run in isolation and as part of the full 359-file gunittest suite in sequence. Marking xfail on Windows per the existing convention rather than guessing at a fix I can't verify; needs investigation with actual Windows access. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B9zVtsN8mY7K5GCrpYwjHW
4 of 6 tasks
echoix
pushed a commit
that referenced
this pull request
Sep 5, 2026
Follow-up to #686: fixing the resource leak there turned a fatal, whole-file-crashing FERROR into three individually diagnosable failures instead. The remaining issue is real but distinct from the leak: the small region these tests set up isn't actually restricting what RasterRow reads back (rast[0] comes back with roughly 100000 elements instead of 10). Built GRASS locally and confirmed this is genuinely Windows-specific, not a state leak this environment can reproduce: the file passes reliably on Linux both run in isolation and as part of the full 359-file gunittest suite in sequence. Marking xfail on Windows per the existing convention rather than guessing at a fix I can't verify; needs investigation with actual Windows access. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B9zVtsN8mY7K5GCrpYwjHW
echoix
force-pushed
the
claude/raster2numpy-region-timing-fix
branch
2 times, most recently
from
September 5, 2026 21:08
4f13a2d to
fee78ab
Compare
test_resampling_1 and test_resampling_2 called rast.close() as a bare statement after their assertions, so a failing assertion (or any other exception) would skip it, leaving the RasterRow open. This repo's own Region.set_raster_region() documents the consequence: "All raster objects must be closed or the process will be terminated." The next test in this file, test_resampling_to_numpy, calls exactly that method on every resampling step, so an open handle carried over from an earlier test crashes it with an unrelated-looking C-level FERROR instead of the real assertion failure ever being reported. Use `with rast:` instead, matching RasterRow's documented context manager support, so the raster is always closed, including when an assertion fails. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
echoix
force-pushed
the
claude/raster2numpy-region-timing-fix
branch
from
September 5, 2026 21:09
fee78ab to
0a385ac
Compare
echoix
pushed a commit
that referenced
this pull request
Sep 5, 2026
Follow-up to #686: fixing the resource leak there turned a fatal, whole-file-crashing FERROR into three individually diagnosable failures instead. The remaining issue is real but distinct from the leak: the small region these tests set up isn't actually restricting what RasterRow reads back (rast[0] comes back with roughly 100000 elements instead of 10). Built GRASS locally and confirmed this is genuinely Windows-specific, not a state leak this environment can reproduce: the file passes reliably on Linux both run in isolation and as part of the full 359-file gunittest suite in sequence. Marking xfail on Windows per the existing convention rather than guessing at a fix I can't verify; needs investigation with actual Windows access. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B9zVtsN8mY7K5GCrpYwjHW
echoix
added a commit
that referenced
this pull request
Sep 5, 2026
Follow-up to #686: fixing the resource leak there turned a fatal, whole-file-crashing FERROR into three individually diagnosable failures instead. The remaining issue is real but distinct from the leak: the small region these tests set up isn't actually restricting what RasterRow reads back (rast[0] comes back with roughly 100000 elements instead of 10). Built GRASS locally and confirmed this is genuinely Windows-specific, not a state leak this environment can reproduce: the file passes reliably on Linux both run in isolation and as part of the full 359-file gunittest suite in sequence. Marking xfail on Windows per the existing convention rather than guessing at a fix I can't verify; needs investigation with actual Windows access. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
echoix
added a commit
that referenced
this pull request
Sep 6, 2026
Follow-up to #686: fixing the resource leak there turned a fatal, whole-file-crashing FERROR into three individually diagnosable failures instead. The remaining issue is real but distinct from the leak: the small region these tests set up isn't actually restricting what RasterRow reads back (rast[0] comes back with roughly 100000 elements instead of 10). Built GRASS locally and confirmed this is genuinely Windows-specific, not a state leak this environment can reproduce: the file passes reliably on Linux both run in isolation and as part of the full 359-file gunittest suite in sequence. Marking xfail on Windows per the existing convention rather than guessing at a fix I can't verify; needs investigation with actual Windows access. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
test_raster_region.py'stest_resampling_1andtest_resampling_2calledrast.close()as a bare statement after their assertions. If an assertion(or anything else) raised, that
close()call was skipped and theRasterRowstayed open for the rest of the process.Region.set_raster_region()documents exactly why that matters:test_resampling_to_numpy, the next test in this file, callsregion.set_raster_region()on every resampling step. So a raster left openby an earlier test doesn't just fail that earlier test — it crashes the
next test with an unrelated-looking C-level
FERROR: Input window changed while maps are open for read, instead of whatever the real original failurewas.
Fixed by using
with rast:(RasterRowalready documents and supports this)instead of a manual
open()/close()pair, so the raster is always closed,assertion failure or not.
Known follow-up
Windows CI on this branch shows the fatal, whole-file-crashing
FERRORisgone, but the file still doesn't fully pass: three individual failures show
up instead (count/value mismatches in
test_resampling_1andtest_resampling_2, and an oversized array allocation intest_resampling_to_numpy). These point to a separate, pre-existing bugwhere the small test region doesn't appear to actually restrict what gets
read back on Windows. I haven't been able to reproduce it without a Windows
machine, so I'm not attempting a fix for it here — this PR only fixes the
resource leak that was masking it.
Motivation and context
Found while investigating Windows CI test-order-dependency:
test_raster_region.pywas one of a small set of consistently-failingWindows gunittest files.
How has this been tested?
Windows CI on this branch (see the follow-up note above) — I couldn't
reproduce or build GRASS on Windows locally.
Types of changes
Checklist
pre-defined prefixes
of this project.