You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
setup-microvm.test.sh: make the attach-bound check deterministic (journal-call count, not elapsed time) #438
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