Harden stuck-job retry accounting and retry config validation
All checks were successful
ci / test (pull_request) Successful in 27s
ci / publish (pull_request) Has been skipped

This commit is contained in:
2026-05-22 21:54:56 +00:00
parent c73aadc660
commit 9028d5b56c
4 changed files with 65 additions and 0 deletions

View File

@@ -23,3 +23,11 @@ def test_job_lease_timeout_must_cover_max_review_runtime(monkeypatch: pytest.Mon
with pytest.raises(ValidationError, match="JOB_LEASE_TIMEOUT_SECONDS must be at least"):
get_settings()
def test_max_stuck_job_retries_must_be_non_negative(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setenv("MAX_STUCK_JOB_RETRIES", "-1")
get_settings.cache_clear()
with pytest.raises(ValidationError, match="MAX_STUCK_JOB_RETRIES must be >= 0"):
get_settings()