Repository navigation
Fix offline connectivity test for fancy busybox ping - #4905
Conversation
CONFIG_FEATURE_FANCY_PING (enabled in #4854, HAOS 18.2) turns `ping HOST` into a continuous ping that never returns without an explicit count. The offline smoke test's connectivity helper ran a bare `ping 1.1.1.1`, so on 18.2+ it blocked until the pytest timeout instead of doing a single probe, failing test_ha_runs_offline (and cascading into the following test modules). Detect the applet at runtime and adapt: use `ping -c 1 -W 2` when the fancy applet is available (which bounds the run), and fall back to the minimal one-shot `ping HOST` otherwise. Match both output styles ("HOST is alive!" vs. ping statistics) and accept "100% packet loss" as a disconnected result. Runtime capability detection keeps the test working on both pre- and post-18.2 images without hard-coding version numbers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe offline smoke tests now detect BusyBox fancy ping support, choose a compatible ping command, and recognize additional success and failure output formats for connectivity checks. ChangesOffline connectivity checks
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes a flaky/hanging offline smoke test by adapting the connectivity probe to BusyBox’s two different ping behaviors (minimal one-shot vs. fancy continuous-by-default), ensuring the test remains bounded and reliable across HAOS versions.
Changes:
- Added runtime detection of the “fancy” BusyBox
pingapplet (supports-c/statistics). - Updated the connectivity helper to use
ping -c 1 -W 2for fancy ping and fallback to bareping HOSTfor minimal ping. - Expanded disconnected-mode acceptance to include the
100% packet lossoutcome as a valid “offline” signal.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The problem
The QEMU test job has failed on the last two
devbuilds. The first failure istest_ha_runs_offline, which times out (pytest-timeout, 120s) and cascades into theos_update/supervisormodules.Root cause: #4854 enabled
CONFIG_FEATURE_FANCY_PINGin busybox (HAOS 18.2+). The fancy applet behaves like iputilsping— a bareping HOSTpings continuously and never returns without an explicit count. The offline connectivity helper ranping 1.1.1.1, so on 18.2+ it blocks forever instead of doing a single probe:The minimal applet on <= 18.1 does the opposite — one-shot
ping HOSTprintsHOST is alive!and rejects-c, so we can't just hard-code-c 1either.The fix
Detect the applet at runtime and adapt:
ping -c 1 -W 2 HOST— bounded, matches on the ping statistics (0% packet loss), and accepts100% packet lossas a disconnected result.ping HOSTand theHOST is alive!string.Runtime capability detection keeps the test working on both pre- and post-18.2 images without gating on
VERSION_ID.Verified by hand against both applets:
Note
This fixes the offline test. The
os_updatefailure in the same job (update to stable reports "Command completed successfully" but never installs to slot B / reboots) is a separate, Supervisor-side issue and is not addressed here.Summary by CodeRabbit
pingimplementations.