Skip to content

fix(release): retry a flaky PyPI in preflight; wait for the log sink's flush - #928

Merged
antosubash merged 1 commit into
mainfrom
fix/log-sink-loop-flake
Nov 13, 2026
Merged

antosubash merged 1 commit into
mainfrom
fix/log-sink-loop-flake

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Why

Release run 43482181032 (the re-run after #927) failed in two places, and neither was caused by the 0.0.46 changes:

  1. preflight → Check PyPI projects: simple_module_inertia: cannot check PyPI: <urlopen error _ssl.c:994: The handshake operation timed out>. A single network error to pypi.org failed the whole release.
  2. checks / Python tests: test_sink_writes_are_not_retained_again failed with assert 6 == 0. The test slept a fixed 1.5 s while the log-sink writer flushes on its own 1 s deadline. On a slow runner the first count ran before the flush (0 rows) and the second ran after it (6 rows).

What

  • scripts/release_preflight.py: _probe retries network errors and HTTP 5xx, 3 attempts with 2 s and 4 s back-off. A 404 (missing project / pending publisher) and other 4xx errors still fail straight away. A real PyPI outage still fails closed, after about 2.5 min in total.
  • The log-sink test now polls until the 5 app lines are stored, with a 15 s cap, and only then starts the 1.5 s window that checks for feedback growth.
  • New scripts/tests/test_scripts_release_preflight_retry.py covers three cases: a transient error is retried, a persistent one still fails, and a 404 is not retried. The existing fail-closed test now stubs sleep. Without the stub, the retries made it take minutes, which I hit locally.

Verification

  • Reproduced the CI failure locally by raising the flush interval to 2.5 s: the old test fails with assert 6 == 0 and the new one passes.
  • make lint ✅, make test-py ✅ (8467 passed, 48 skipped).

No CHANGELOG entry: release tooling and tests only.

https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4

…s flush

Release run 43482181032 failed twice over:

- preflight: one TLS handshake timeout to pypi.org failed the release.
  _probe now retries network errors and 5xx (3 attempts, 2s/4s back-off);
  a 404 and other 4xx still answer at once.
- test_sink_writes_are_not_retained_again: a fixed 1.5s sleep raced the
  writer thread's 1s flush deadline, so a slow runner read 0 rows, then 6.
  Poll until the app lines are stored before the observation window.

Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: eb3fa25
Status: ✅  Deploy successful!
Preview URL: https://fb8f9206.simple-module-python.pages.dev
Branch Preview URL: https://fix-log-sink-loop-flake.simple-module-python.pages.dev

View logs

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-13T19:08:18.290513Z eb3fa25 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@antosubash
antosubash merged commit 3b40508 into main Nov 13, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant