Repository navigation
fix: ✅ Make attach-wait test deterministic - #855
Conversation
Signed-off-by: Evaline Ju <[email protected]>
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Summary
Replaces the wall-clock assertion (SECONDS - t0 <= 7) in the churn attach-wait test with a count of journal reads, so it no longer flakes on a slow host. Verified against verify_attached_remote (setup-microvm.sh:618): sleep is not mocked, so with MICROVM_ATTACH_TIMEOUT=2 MICROVM_ATTACH_SETTLE=2 the first churning poll's 2 s settle always outlasts the deadline (SECONDS can only advance by at least 2 s), giving exactly 2 journal reads however loaded the host is. A regression to a count of polls (for ((i = 0; i < TIMEOUT; i++))) does 2 polls = 4 reads, and one that checks the deadline before the first poll does 0, so both still fail the check. The new comment matches the behaviour. Closes #438.
Author: evaline-ju (MEMBER — maintainer)
Areas reviewed: Shell (test)
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: passing (16/16, including deploy-scripts and deploy-scripts-bash32)
clawgenti
left a comment
There was a problem hiding this comment.
Summary
The PR replaces the wall-clock timing assertion in the attach-wait churn test with a journal-read count, which removes the host-load flakiness while keeping the test's power: I verified empirically on head that the suite passes, and that reverting verify_attached_remote to a poll-counting loop makes exactly this new check fail (want '2', got '4'). No blocking findings; the change is small, well-commented, and the checklist's N/A marks on docs are right for a test-only change.
Author: evaline-ju (CONTRIBUTOR — returning external)
Areas reviewed: Shell (test), conventions, CI, security
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, signed-off: yes
CI status: all checks passing (shellcheck, deploy-scripts, deploy-scripts-bash32, microvm-gates, CodeQL, Trivy, DCO, lint, docs)
Verified by: ran the full deploy/microvm/tests/setup-microvm.test.sh on head (PASS, exit 0); ran a throwaway mutation probe reverting the deadline-bounded loop to for ((i = 0; i < MICROVM_ATTACH_TIMEOUT; i++)) — the new check failed as intended and the probe was reverted and deleted; bash -n and shellcheck clean on the test file.
Generated by RepoMan github-pr-review@9672454 (https://github.com/rossoctl/agent-skills/blob/96724547c162978f58d845b9a8331a679bf39444/skills/github-pr-review/SKILL.md).
clawgenti
left a comment
There was a problem hiding this comment.
Summary
The PR replaces the wall-clock timing assertion in the attach-wait churn test with a journal-read count, which removes the host-load flakiness while keeping the test's power: I verified empirically on head that the suite passes, and that reverting verify_attached_remote to a poll-counting loop makes exactly this new check fail (want '2', got '4'). No blocking findings; the change is small, well-commented, and the checklist's N/A marks on docs are right for a test-only change.
Author: evaline-ju (CONTRIBUTOR — returning external)
Areas reviewed: Shell (test), conventions, CI, security
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, signed-off: yes
CI status: all checks passing (shellcheck, deploy-scripts, deploy-scripts-bash32, microvm-gates, CodeQL, Trivy, DCO, lint, docs)
Verified by: ran the full deploy/microvm/tests/setup-microvm.test.sh on head (PASS, exit 0); ran a throwaway mutation probe reverting the deadline-bounded loop to for ((i = 0; i < MICROVM_ATTACH_TIMEOUT; i++)) — the new check failed as intended and the probe was reverted and deleted; bash -n and shellcheck clean on the test file.
Generated by RepoMan github-pr-review@9672454 (https://github.com/rossoctl/agent-skills/blob/96724547c162978f58d845b9a8331a679bf39444/skills/github-pr-review/SKILL.md).
Summary
The attach-wait check in
setup-microvm.test.shcould fail on a slow host because it measured elapsed time. It now counts journal reads instead, and it still catches the old poll-counting loop.Closes #438
Assisted-By: Claude Code
Checklist
git commit -s).make lintand the tests for the touched packages pass.docs/page, with the right maturity label (seedocs/CONTRIBUTING-DOCS.md). - N/A as test changemake check-linkspasses if any Markdown changed. - N/Adocs/specs/README.mdordocs/adrs/README.md. - N/A