Skip to content

fix: ✅ Make attach-wait test deterministic - #855

Merged
evaline-ju merged 1 commit into
rossoctl:mainfrom
evaline-ju:microvm-test
Nov 17, 2026
Merged

evaline-ju merged 1 commit into
rossoctl:mainfrom
evaline-ju:microvm-test

Conversation

@evaline-ju

@evaline-ju evaline-ju commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The attach-wait check in setup-microvm.test.sh could 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

  • Commits are signed off (git commit -s).
  • make lint and the tests for the touched packages pass.
  • Docs: changed behavior, flags or environment variables are reflected in the relevant README or
    docs/ page, with the right maturity label (see docs/CONTRIBUTING-DOCS.md). - N/A as test change
  • Docs: make check-links passes if any Markdown changed. - N/A
  • A new spec or ADR is registered in docs/specs/README.md or docs/adrs/README.md. - N/A

@evaline-ju evaline-ju added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 17, 2026

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 clawgenti left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 clawgenti left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@evaline-ju
evaline-ju merged commit 0eee39b into rossoctl:main Nov 17, 2026
17 checks passed
@evaline-ju
evaline-ju deleted the microvm-test branch November 17, 2026 16:45
@pdettori pdettori added this to the v0.11.0 milestone Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setup-microvm.test.sh: make the attach-bound check deterministic (journal-call count, not elapsed time)

4 participants