Repository navigation
Make SETUP.sh reproduce CI, and stop the SCRIP fixture OOMing - #191
Merged
Merged
Conversation
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.
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.
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 syncand an unfilteredpytest tests/ --ignore=tests/test_remote_agent.py, from before the suite moved tomarker-based selection. Following it today:
Every failure a
ModuleNotFoundError— 16hpc-marked tests wantingglobus_compute_sdk, 3yac-marked tests wanting a YAC build. The first thinga new contributor runs told them the project was broken.
Now syncs
--extra hpc --devand 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 abroken hpc extra is reported as itself rather than vanishing into the main run.
The hpc tests are mocked and need no cluster.
yacandliveare printed asdeliberately not run rather than being silently absent.
2. The
--ignorewas hiding passing testspytest.inialready says CI selects by marker and never by filename. This wasthe 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
.python-versionpins 3.12 and uv provisions that interpreter itself, so thepython3on PATH is not the one the project runs on. On a machine with 3.9 onPATH the script exited 1 and refused to install — while
uv syncon that samemachine 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.pybuilt each dask array as a single2000 × 3,500,000uint8 chunk — 6.5 GiB per array, 13 GiB for the two — andto_netcdfmaterializes a chunk at a time. Measured peak RSS for that onetest: 7.45 GiB. Fits GitHub's 16 GiB runners, does not fit a laptop, so the
runners masked it.
Chunking along
grid_cornersto(2000, 100_000)holds each write to ~191MiB. Intent is unchanged — the guard reads
corner_var.size, the declaredshape, and never touches the data, so it still refuses a grid whose footprint
is ~104 GiB against a 100 GiB threshold.
test_subset_bbox_lazy.py(3 tests)Guard
TestSetupScriptMatchesCIholds SETUP.sh to the hpc extra, to marker-basedselection, and to not gating on the ambient interpreter. Reverting any of the
three fails it (verified). It parses only the
pytestcommand lines, so thecomment explaining why
--ignoreis wrong does not trip its own check.Verification
Ran the edited SETUP.sh end to end in a clean clone, on a box whose
python3is 3.9.18:
No failures. Full selected suite on the branch: 1511 passed, 1 skipped, 44
deselected, 1 xfailed.