Repository navigation
tests/test_release_workflow.py makes a served-digest read fail with a URLError that has no HTTP status, and another time out, so release.yml's except cannot lose either member with the suite green (closes opensoft/openRepoTools#286) - #9
Merged
Conversation
… URLError that has no HTTP status and requires the check to read again, so release.yml's except cannot be narrowed past URLError with the suite green (#286) After each upload the job reads the index's JSON up to 20 times, 15 seconds apart, and retries a read that fails with `except (urllib.error.URLError, TimeoutError, ConnectionError)`. No case made a read fail with a URLError that has no status: SERVED_CASES answered with a status (200, 403, 404 or 503) or with DROPPED, a connection closed with no response, which raises http.client.RemoteDisconnected and so exercised only the ConnectionError member. Lane openRepoTools-2's re-check of #284 narrowed that except to (HTTPError, TimeoutError, ConnectionError) at release.yml:1223 and :1723, and the suite stayed green. FakeIndex now answers REFUSED, a 302 to a port nobody listens on (a socket it binds and never listens on, so nobody else takes the port and the connection is refused). urllib follows the redirect, and its connection fails with `URLError(ConnectionRefusedError)` and no `code`. The new SERVED_CASES case, a-refused-connection-then-served, has the index answer REFUSED and then SERVED in each upload job: the step reads twice, sleeps once and passes. The test also requires the step's output to carry `<urlopen error`, so the case cannot slip back to a ConnectionError and stop testing the URLError member. With the except narrowed in both upload jobs, the 22 older served-check cases still pass and the 2 new ones fail: the first refused read raises the URLError uncaught, and the step exits 1 with a traceback. A read that times out is not added. The step's urlopen waits its real 30 second timeout, which the fake clock does not shorten, and no case can make one without waiting it out. Only tests/test_release_workflow.py changes, and release.yml is as it was. -k test_release_workflow: 501 passed. A branch for the code leg, not a pull request: it is cherry-picked into openRepoTools-code after v1.1.0 is tagged. Part of #286. Lane: openRepoTools-2 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> (cherry picked from commit 35b18b2ff14c41585d83d9f605d4efd11ed719a5)
…d requires the check to read again, so release.yml's except cannot drop TimeoutError with the suite green (#286) After each upload the job reads the index's JSON up to 20 times, 15 seconds apart, and retries a read that fails with `except (urllib.error.URLError, TimeoutError, ConnectionError)`. No case made a read time out: the step's `urlopen(timeout=30)` waits a real 30 seconds, which the fake clock does not shorten, so no case held the `TimeoutError` member. A read the index takes and never answers raises a bare `TimeoutError` out of `getresponse()`, not wrapped in a `URLError`, so no other member of the except catches it. FakeIndex now answers TIMED_OUT (the status 0): it takes the request, says nothing, and holds the connection until the client closes it (HELD_FOR, 10 seconds at most). The CLOCK `sitecustomize` gains one thing, where a case sets FAKE_READ_TIMEOUT: the timeout of the step's FIRST connection is cut from the 30 seconds the step asks for to READ_TIMEOUT, 0.5 seconds. It only ever cuts a timeout, and a later read keeps the step's own. The step's own `urlopen` then times out through a real socket after half a second, and release.yml is as it was. The new SERVED_CASES case, a-timed-out-read-then-served, has the index answer TIMED_OUT and then SERVED in each upload job: the step reads twice, sleeps once and passes. The test also requires the step's output to carry `did not answer yet (timed out)`, so the case cannot slip into a dropped connection, which the step passes through its ConnectionError member and which never reaches TimeoutError. With the clamp off, the step does exactly that: it exits 0 after the 10 second hold and prints `(Remote end closed connection without response)`. With `TimeoutError` removed from the except at release.yml:1223 and :1723, the 24 other served-check cases still pass and the 2 new ones fail: the first read raises `TimeoutError: timed out` out of `getresponse()`, uncaught, and the step exits 1 with a traceback. Each new case takes under a second. Run outside pytest on Python 3.10, 3.11, 3.12, 3.13 and 3.14, the step passes as written and fails the same way with the member removed. Before Python 3.10 a timed-out read raises `socket.timeout`, which is not `TimeoutError`, so the case skips there, as run_heredoc skips below 3.11 for tomllib; the upload jobs run on the runner's 3.12. Only tests/test_release_workflow.py changes, and release.yml is as it was. -k test_release_workflow: 503 passed. On the same branch as 35b18b2, still no pull request. Part of #286. Lane: openRepoTools-2 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit ae3e8e0cfc43362be0a325acb33ddab1ff09c009)
Reviewer's GuideTestsExtend the fake index and clock to produce refused and timed-out reads, then assert both served-digest checks retry and pass with the expected diagnostics.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
The in-place merge of runbook v9: the stack grows by this clean merge, with no force-push. Lane: openRepoTools-2 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The in-place merge of runbook v9: the stack grows by this clean merge, with no force-push. Lane: openRepoTools-2 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
brettheap
dismissed
sourcery-ai[bot]’s stale review
November 9, 2026 21:58
The base branch was changed.
This was referenced Nov 9, 2026
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.



Lane: openRepoTools-2
Claim: opensoft/openRepoTools#286 (comment)
release.yml's served-digest check reads the index's JSON up to 20 times and retries a read that
fails with a URLError, a TimeoutError or a ConnectionError. No case made a read fail with a URLError
that has no HTTP status, or time out, so the except could be narrowed with the suite green.
FakeIndex now answers REFUSED (a redirect to a port nobody listens on) and TIMED_OUT (it takes the
request and says nothing), and a new served-check case for each, in each upload job, requires the
step to read again and pass. With the matching member removed from the except in both upload jobs,
the older cases still pass and the new ones fail. Only tests/test_release_workflow.py changes, and
release.yml is as it was.
The picks, from lane openRepoTools-2's branches in opensoft/openRepoTools, each made with
git cherry-pick -xand followed by its source commit:(cherry picked from commit 35b18b2ff14c41585d83d9f605d4efd11ed719a5)
(cherry picked from commit ae3e8e0cfc43362be0a325acb33ddab1ff09c009)
Closes opensoft/openRepoTools#286.
Lane: openRepoTools-2
Co-Authored-By: Claude Sonnet 5.5 [email protected]
Co-Authored-By: Claude Opus 5.5 [email protected]
🤖 Generated with Claude Code
Summary by Sourcery
Ensure release workflow tests prevent narrowing served-digest retry handling for refused connections and timed-out reads.
Enhancements:
Tests: