Skip to content

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

Closed

Description

@pdettori

Follow-up from #437, P6 on Kubernetes slice 2 (#424). The final review flagged this.

Where: deploy/microvm/tests/setup-microvm.test.sh, the attach-bound check added with the wall-clock deadline in verify_attached_remote. It measures elapsed time with SECONDS and allows 7 s for a wait of about 5 s.

Why it matters: the measurement covers the whole mocked install, not just the wait, and SECONDS has whole-second resolution. That leaves about 1 s of slack, which a loaded CI host can exceed, so the check can fail on a correct script. With sleep real and MICROVM_ATTACH_SETTLE=1, the suite also went from about 17 s to about 28 s.

Fix:

  • Assert on the journalctl mock's call counter instead of time. With MOCK_JOURNAL_CHURN=1, MICROVM_ATTACH_TIMEOUT=3 and MICROVM_ATTACH_SETTLE=2, the deadline loop makes at most 2 polls (≤ 4 journal reads). The old iteration-counting loop always makes 6.
  • Load can only reduce the number of polls, so the assertion cannot flake, and it still fails the old loop.
  • Keep a loose time check (<= 15) as a secondary guard, or drop it.

Activity

  1. added
    enhancement
    on Oct 5, 2026
  2. added this to the v0.11.0 milestone on Nov 17, 2026
  3. self-assigned this
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions