Skip to content

Fix flaky test_merge_dask_different_crs_matches_eager on macOS#1495

Merged
brendancol merged 1 commit intomainfrom
fix-pyproj-threading-flake
May 5, 2026
Merged

Fix flaky test_merge_dask_different_crs_matches_eager on macOS#1495
brendancol merged 1 commit intomainfrom
fix-pyproj-threading-flake

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

What

Pin test_merge_dask_different_crs_matches_eager to the synchronous
dask scheduler and pre-warm the PROJ CRS database before the parity
assertion.

Why

This test SIGABRTs intermittently on macOS CI runners. Same crash
signature on:

Both pin the abort at xrspatial/tests/test_reproject.py:2460
the .compute().values call that triggers the dask threaded scheduler.

The merge dask graph creates a fresh pyproj.Transformer per chunk.
PROJ's first-time CRS-database load is a race when multiple threads
hit the SQLite-backed database at once on macOS. Linux and Windows
typically serialise enough that the race is invisible.

The test asserts dask-graph correctness, not threading correctness.
Synchronous compute exercises the same graph without the threading
dimension. Production reproject thread-safety is a separate concern
and is not regressed here.

Test plan

  • Test passes locally on Linux 5×5 in a row
  • CI: macOS jobs no longer SIGABRT

test_merge_dask_different_crs_matches_eager intermittently SIGABRTs
on macOS CI runners. The merge() dask graph creates a fresh
pyproj.Transformer per chunk, and PROJ's first-time CRS-database load
is not safe under concurrent threaded workers — multiple threads racing
to init the SQLite DB on macOS triggers an abort.

The test exercises dask graph correctness, not dask threading. Pin it
to the synchronous scheduler and pre-warm pyproj.CRS objects so the
parity assertion runs without the threading dimension. CRS
thread-safety in the production reproject path is its own concern and
is not regressed here.

Refs the same crash on PR #1492 macOS-3.13 and on main run e253900
(macOS-3.12).
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 5, 2026
@brendancol brendancol merged commit aa0d264 into main May 5, 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