Repository navigation
ci(unit-tests): save each xdist worker's coverage at session finish and keep the process log (#1423) - #1424
Merged
Conversation
…nd keep the process log (#1423) - tests/conftest.py: a pytest_sessionfinish hook saves an xdist worker's auto-started coverage before shutdown, so a worker that dies after reporting its results no longer loses its whole data file. - .github/coverage.toml: sigterm = true, so a SIGTERM saves the data too. - unit-tests.yml: the guard names each missing pid's command line and whether its atexit save ran; coverage-processes.log is now uploaded as the coverage-processes-log artifact on every coverage leg. - docs: unit-tests.yml citations renumbered by line content; the coverage section mentions the save and the new artifact. tests/project: 404 passed, 1 skipped; the 5 new tests fail without the fix.
Contributor
|
Coverage: 89.43% (unit tier, Python 3.14,
Per-file detail: the |
Owner
Author
|
Verdict: GOOD TO GO at
|
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.
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
Established: each missing pid is a real xdist worker (4 controller children,
cpu_count 4), and it died after reporting its results, which is why every test passed. xdist ignores a worker's EOF afterworkerfinished. No log has a traceback. A process with no data still writes a file, so nothing ran itsatexitsave to completion. Not established: what killed it. execnet SIGKILLs after 10 s, but a measured save takes 0.24 s, so a crash during finalisation is the other candidate. Nothing in the #1409–#1412 diff spawns or kills a process.Ruled out: runner image/Python (hits on both 20260927/3.14.7 and 20261004/3.14.8); test count (first hit ran 3195, the same as a clean run);
chdir(data path is absolute); a test touching coverage (none does).Changes:
tests/conftest.py:pytest_sessionfinishsaves a worker's coverage before shutdown..github/coverage.toml:sigterm = true.unit-tests.yml: the guard prints each missing pid's cmd and atexit fate, andcoverage-processes.logis uploaded as an artifact. Doc citations are renumbered.tests/project: 404 passed, 1 skipped. The 5 new tests fail without the fix.Closes #1423