Repository navigation
ci(unit-tests): cap the size of files tests write on every pytest step (#1969) - #1973
Conversation
#1969) - Add util/cap_file_size.py: sets RLIMIT_FSIZE, soft and hard, to 2 GiB (keeping a lower hard limit), restores SIGXFSZ's default and execs the command, so a write past the cap fails with `File too large`. - Run every pytest and unittest command in unit-tests.yml through it: test, integration, pypcap-parity and their KTLO twins, the engine cells, unittest-ordering, project-tests and gate. project-tests drops its own `ulimit -f`, so the limit lives in one place. - Pin it in tests/project/test_file_size_caps_1969.py: a test command without the script fails, and the script is run against a small limit. - The step stubs in the tier guard and the #1732 pin hand the script to the real interpreter, so they still record the capped command. - Describe the caps on the workflows page. Closes #1969
|
GOOD TO GO at |
|
NEEDS CHANGES at |
…ontroller (#1969) - The python stubs in the tier guard and the #1732 pin handed util/cap_file_size.py to the real interpreter. On the coverage leg that process was measured, logged its `coverage run --rcfile` argv as a second controller and exec'd before saving, so the #1387 guard failed. - The stubs now exec the capped command themselves, as the script does, with no real interpreter; each module gains a test that the real one is not started for it. Refs #1969
|
GOOD TO GO at |
|
Coverage: 90.07% (unit tier, Python 3.15,
Per-file detail: the |
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
ci— workflows or build toolingDescription of your pull request and other information
Caps every file a test writes at 2 GiB, on every pytest and unittest step of
unit-tests.yml(#1969). #1372 once wrote a 6 GBout.jsonper run.util/cap_file_size.pysetsRLIMIT_FSIZE(soft and hard), restoresSIGXFSZ's default action, and execs the command. Exit codes andcontinue-on-errorare unchanged, and a breach raisesFile too large.test,integration,pypcap-parity(and their KTLO twins), the engine cells,unittest-ordering,project-testsandgate.project-testsdrops its ownulimit -f, so the limit lives in one place.tests/project/test_file_size_caps_1969.pyfails on any uncapped test command, and exercises the script at a small limit.workflows.rstgains a "File Size Caps" section.cron-python-versions.yml's single unittest run is outside this PR's scope and stays uncapped.Closes #1969