Skip to content

Make SETUP.sh reproduce CI, and stop the SCRIP fixture OOMing - #191

Merged
rajeeja merged 1 commit into
mainfrom
setup-and-fixture-match-ci
Oct 21, 2026
Merged

rajeeja merged 1 commit into
mainfrom
setup-and-fixture-match-ci

Conversation

@rajeeja

@rajeeja rajeeja commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Two things made a green tree look broken on a developer machine. Neither was a
defect in the server — and investigating them turned up two more problems in
the same places.

1. SETUP.sh had drifted from CI

It ran a bare uv sync and an unfiltered pytest tests/ --ignore=tests/test_remote_agent.py, from before the suite moved to
marker-based selection. Following it today:

19 failed, 1494 passed

Every failure a ModuleNotFoundError — 16 hpc-marked tests wanting
globus_compute_sdk, 3 yac-marked tests wanting a YAC build. The first thing
a new contributor runs told them the project was broken.

Now syncs --extra hpc --dev and runs CI's own partition: -m "not hpc and not live and not yac", then -m "hpc and not yac" as a separate step, so a
broken hpc extra is reported as itself rather than vanishing into the main run.
The hpc tests are mocked and need no cluster. yac and live are printed as
deliberately not run rather than being silently absent.

2. The --ignore was hiding passing tests

pytest.ini already says CI selects by marker and never by filename. This was
the counter-example, and it was hiding 16 tests in that file that pass.
Dropping it takes the local run from 1493 to 1509 selected.

3. The prerequisite check refused the wrong interpreter

[ERROR] Python 3.11 or newer is required.

.python-version pins 3.12 and uv provisions that interpreter itself, so the
python3 on PATH is not the one the project runs on. On a machine with 3.9 on
PATH the script exited 1 and refused to install — while uv sync on that same
machine builds a working 3.12 environment. It rejected the one interpreter that
does not matter. This is why I could not run SETUP.sh end-to-end until I fixed
it.

The 3.12 Globus-submitter warning is kept, moved after the sync and asked of
uv run python, which is the interpreter that would actually submit the task.

4. The oversized-SCRIP fixture OOMs below 8 GiB

test_subset_bbox_lazy.py built each dask array as a single 2000 × 3,500,000 uint8 chunk — 6.5 GiB per array, 13 GiB for the two — and
to_netcdf materializes a chunk at a time. Measured peak RSS for that one
test: 7.45 GiB. Fits GitHub's 16 GiB runners, does not fit a laptop, so the
runners masked it.

Chunking along grid_corners to (2000, 100_000) holds each write to ~191
MiB. Intent is unchanged — the guard reads corner_var.size, the declared
shape, and never touches the data, so it still refuses a grid whose footprint
is ~104 GiB against a 100 GiB threshold.

before after
test_subset_bbox_lazy.py (3 tests) 7.45 GiB 1.67 GiB
full selected suite — 1.36 GiB

Guard

TestSetupScriptMatchesCI holds SETUP.sh to the hpc extra, to marker-based
selection, and to not gating on the ambient interpreter. Reverting any of the
three fails it (verified). It parses only the pytest command lines, so the
comment explaining why --ignore is wrong does not trip its own check.

Verification

Ran the edited SETUP.sh end to end in a clean clone, on a box whose python3
is 3.9.18:

[SETUP] Running automated tests (no external data required)...
1509 passed, 44 deselected, 1 xfailed
[SETUP] Running HPC tests (mocked; no cluster required)...
35 passed, 2 skipped, 1517 deselected

No failures. Full selected suite on the branch: 1511 passed, 1 skipped, 44
deselected, 1 xfailed.

Two things made a green tree look broken on a developer machine. Neither
was a defect in the server.

SETUP.sh had drifted. It ran a bare `uv sync` and an unfiltered
`pytest tests/ --ignore=tests/test_remote_agent.py`, from before the
suite moved to marker-based selection. Following it today gives 19
failures, every one a `ModuleNotFoundError`: 16 hpc-marked tests wanting
globus_compute_sdk, 3 yac-marked tests wanting a YAC build. The first
thing a new contributor runs told them the project was broken.

It now syncs `--extra hpc --dev` and runs CI's own partition --
`-m "not hpc and not live and not yac"`, then `-m "hpc and not yac"` as
a separate step so a broken hpc extra is reported as itself. The hpc
tests are mocked and need no cluster, so there is no reason to skip
them. `yac` and `live` are named in the output as deliberately not run,
rather than silently absent.

The `--ignore` is gone. pytest.ini already says CI selects by marker and
never by filename, and this was the counter-example: it was hiding 16
tests in that file that pass. Dropping it takes the local run from 1493
to 1509 selected.

Also removed the `python3 -c 'assert sys.version_info >= (3, 11)'` gate.
`.python-version` pins 3.12 and uv provisions that interpreter itself,
so the python3 on PATH is not the one the project runs on. On a machine
with 3.9 on PATH the script exited 1 and refused to install, while
`uv sync` on that same machine builds a working 3.12 environment -- it
rejected the one interpreter that does not matter. The 3.12 submitter
warning is kept, moved after the sync and asked of `uv run python`,
which is the interpreter that would actually submit the task.

Separately, `test_subset_bbox_lazy.py`'s oversized-SCRIP fixture built
each dask array as a single 2000 x 3,500,000 uint8 chunk -- 6.5 GiB per
array, 13 GiB for the two -- and `to_netcdf` materializes a chunk at a
time. Measured peak RSS for that one test was 7.45 GiB, which fits
GitHub's 16 GiB runners and does not fit a laptop. Chunking along
grid_corners holds each write to ~191 MiB. The test is unchanged in
intent: the guard reads `corner_var.size`, the declared shape, and never
touches the data, so it still refuses a grid whose footprint is ~104 GiB
over a 100 GiB threshold. That file's three tests go from 7.45 GiB peak
to 1.67 GiB; the full selected suite now peaks at 1.36 GiB.

`TestSetupScriptMatchesCI` holds SETUP.sh to the hpc extra, to
marker-based selection, and to not gating on the ambient interpreter.
Reverting any of the three fails it. Verified by running the edited
SETUP.sh end to end in a clean clone on a box whose python3 is 3.9.18:
1509 passed, then 35 passed, 2 skipped. No failures.
@rajeeja
rajeeja merged commit 037bcc4 into main Oct 21, 2026
13 checks passed
@rajeeja
rajeeja deleted the setup-and-fixture-match-ci branch October 21, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant