Skip to content

Comments

TST: Fix test fixture for test_reproject_error_propagation#3360

Merged
snowman2 merged 1 commit intorasterio:mainfrom
QuLogic:fix-test-fixture
Nov 6, 2025
Merged

TST: Fix test fixture for test_reproject_error_propagation#3360
snowman2 merged 1 commit intorasterio:mainfrom
QuLogic:fix-test-fixture

Conversation

@QuLogic
Copy link
Contributor

@QuLogic QuLogic commented Jun 11, 2025

Pickling the HTTP server requires the 'fork' multiprocessing context, and in some places, HTTPServer.server_name returns something that doesn't work with curl. So force the 'fork' mode, and use HTTPServer.server_address instead.

Also, remove the network marker, as it does nothing for fixtures and isn't required since that marker signifies external networking.

Fixes #3357
Fixes #3403

@sgillies
Copy link
Member

@QuLogic can you say more about what places this doesn't work and why pickling is important?

@QuLogic
Copy link
Contributor Author

QuLogic commented Jun 12, 2025

Pickling is something that multiprocessing seems to do itself. See the traceback in the linked issue, which is a problem in Python 3.14 as the default context changed.

HTTPServer.server_name returns something that doesn't work with curl.

For this, I'm not entirely sure the cause yet, but the server_name somehow becomes a random hash instead of localhost.localdomain on Fedora Rawhide/42 mock container. This may in fact be a bug somewhere else in the stack, but using server_address gives an address that seems to work in all cases.

Pickling the HTTP server requires the 'fork' multiprocessing context,
and in some places, `HTTPServer.server_name` returns something that
doesn't work with curl. So force the 'fork' mode, and use
`HTTPServer.server_address` instead.

Also, remove the `network` marker, as it does nothing for fixtures and
isn't required since that marker signifies _external_ networking.
@adamjstewart
Copy link
Contributor

why pickling is important?

To add on here, TorchGeo uses rasterio in most of its data loaders to load data in parallel. This requires multiprocessing, which requires in-memory objects to be pickle-able in many multiprocessing contexts. I don't think we specifically rely on HTTP server, so as long as the other components work with the new multiprocessing context then we're fine.

@snowman2 snowman2 merged commit 6f1f1ed into rasterio:main Nov 6, 2025
26 checks passed
@snowman2
Copy link
Member

snowman2 commented Nov 6, 2025

Thanks @QuLogic 👍

@snowman2 snowman2 added the backport-1.4 To be backported to maint-1.4 label Nov 6, 2025
snowman2 pushed a commit that referenced this pull request Nov 6, 2025
Pickling the HTTP server requires the 'fork' multiprocessing context,
and in some places, `HTTPServer.server_name` returns something that
doesn't work with curl. So force the 'fork' mode, and use
`HTTPServer.server_address` instead.

Also, remove the `network` marker, as it does nothing for fixtures and
isn't required since that marker signifies _external_ networking.
@QuLogic QuLogic deleted the fix-test-fixture branch November 20, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-1.4 To be backported to maint-1.4 testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TST: PytestRemovedIn9Warning: Marks applied to fixtures have no effect test_reproject_error_propagation fails on Python 3.14

4 participants