Skip to content

test: poll for the first heartbeat tick instead of a fixed sleep - #19

Merged
Mearman merged 1 commit into
mainfrom
test/deflake-heartbeat
Sep 13, 2026
Merged

Mearman merged 1 commit into
mainfrom
test/deflake-heartbeat

Conversation

@Mearman

@Mearman Mearman commented Sep 13, 2026

Copy link
Copy Markdown
Member

Summary

The release job's own `prepublishOnly` run failed on CI: `the heartbeat touches the registry on interval` slept a fixed 120ms (6x the 20ms heartbeat interval) then checked once whether the registry's `updatedAt` had moved, and lost that race on a loaded runner. Polling for the first tick against an overall 5s deadline removes the fixed-wait race entirely.

Test plan

  • Passes reliably across repeated local runs
  • Full suite green, coverage still 100 percent
  • CI verify passes

The release job's prepublishOnly run failed this test on CI: it slept
a fixed 120ms (6x the 20ms heartbeat interval) and checked once whether
the registry's updatedAt had moved. A real setInterval carries no
delivery guarantee under a busy scheduler, so a single fixed wait is a
race against however loaded the runner happens to be at that instant,
not against the interval itself. Polling in 20ms steps up to a 5s
deadline only needs one tick to ever land, however late the runner
makes it, so the test's outcome no longer depends on the runner's
momentary CPU pressure.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-13T05:50:42.345847Z 9f2e254 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.

@Mearman
Mearman merged commit 4e84859 into main Sep 13, 2026
4 checks passed
@Mearman
Mearman deleted the test/deflake-heartbeat branch September 13, 2026 05:50
@exaclaude

exaclaude Bot commented Sep 13, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.1.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@exaclaude exaclaude Bot added the released label Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant