Repository navigation
fix: prevent internal errors from non-finite rerun delays - #391
Open
Arham-Begani wants to merge 1 commit into
Open
Arham-Begani wants to merge 1 commit into
Arham-Begani wants to merge 1 commit into
Conversation
Author
|
Could a maintainer approve the pending upstream Actions runs when convenient? The submitted head is Upstream CI approval and code review are still pending. The PR's existing description separates these fork results from upstream validation and records the 16 before/after regressions. No source changes were made for this follow-up. This comment was prepared with OpenAI Codex assistance. |
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.
Closes #390.
Problem
float()and the CLI's float argument parser accept NaN and infinity. The delay getters currently reject negative values but pass these non-finite values to the retry calculation andtime.sleep, aborting the session with INTERNALERROR / exit code 3.For example, a test that passes on its third execution never completes with
--reruns 2 --reruns-delay=nan. Both non-finite delay values and non-finite backoff factors reproduce the problem. See #390 for four real-sleep commands and observed exceptions.Changes
The retry formula is unchanged. This fixes explicit non-finite input; it does not duplicate #389's separate large-finite-factor overflow fix.
Validation
Windows, CPython 3.13.15, pytest 9.1.1, pytest-xdist 3.8.0:
01fd226bd533ecd7f6aabe7c155c4ca7bcd8598c; all 16 pass with this patch.time.sleepreproductions changed from INTERNALERROR / exit 3 to1 passed, 2 rerun/ exit 0.pytest -vv -o faulthandler_timeout=30 tests/). An initial quiet run stopped making progress and was terminated; the diagnostic rerun completed without failures or timeout traces in 83.14 seconds.pre-commit run --all-files --show-diff-on-failurechecks passed; commit hooks passed on changed files.towncrier check --compare-with origin/masterandgit diff --checkpassed.--ignore-missing-imports. Without that flag, this environment reports missing imports forexceptiongroupand_pytest.nodeid; this is not claimed as a clean unrestricted type check.Fork CI at the submitted commit
a2494ae697fbc2fe439cc4b0538ff3877ded4423completed successfully: all 41 test jobs passed, covering the Python/pytest matrix, PyPy, xdist, free-threaded Python, Linux, Windows and macOS. The docs workflow also passed. Results:Upstream Actions currently reports
action_requiredfor its four workflows and needs maintainer approval to run. The upstream Read the Docs preview passed. Fork success is reported separately from upstream CI and maintainer acceptance.AI assistance
An AI coding assistant investigated, implemented, tested and drafted this contribution with the account owner's authorization. No personal human review or authorship certification is claimed. Maintainer review is welcome.