test(cli): fix local platform assumptions - #1098
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR improves CLI test reliability. The privileged-port test handles bind outcomes explicitly. The disk stress test runs the fill asynchronously and verifies concurrent bystander writes and ChangesCLI test reliability
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
9eef54b to
3e98847
Compare
📦 BoxLite review — looks good ·
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/cli/tests/stress_disk.rs`:
- Around line 670-674: Update the stress test’s fill execution to start the `dd`
process asynchronously, poll the bystander log via `line_count(&bystander)`
while the fill process remains running, and require an observed increase before
awaiting fill completion. Preserve the existing completion handling and progress
assertion, then wait for the fill process to finish after progress is detected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 59f8463a-28c2-45cd-b8d6-e3ad8f13b412
📒 Files selected for processing (2)
src/cli/tests/gvproxy_port_conflict.rssrc/cli/tests/stress_disk.rs
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/cli/tests/stress_disk.rs`:
- Around line 658-661: Move the fill-test status artifacts currently written to
/tmp— including fill.out and fill.done in the script around the fill loop and
the corresponding paths through the additionally affected cases—onto a guest
tmpfs/ramfs location with a generous independent capacity, or use another
completion channel outside the bounded rootfs. Update all writers, pollers,
cleanup commands, and references consistently so rootfs exhaustion cannot
prevent status reporting.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ad6e353c-7268-43f8-b060-6e9898b423aa
📒 Files selected for processing (1)
src/cli/tests/stress_disk.rs
| "rm -f /tmp/fill.done /tmp/fill.out; \ | ||
| i=0; while dd if=/dev/zero of=/fill.$i bs=1M count=1; do \ | ||
| i=$((i + 1)); sleep 0.25; \ | ||
| done > /tmp/fill.out 2>&1; touch /tmp/fill.done", |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Map the changed test before inspecting its mount and rootfs setup.
ast-grep outline src/cli/tests/stress_disk.rs --items all
sed -n '608,741p' src/cli/tests/stress_disk.rs
# Locate guest filesystem and mount configuration.
rg -n -i -C 4 'tmpfs|/tmp|rootfs|mount|filesystem|overlay' srcRepository: boxlite-ai/boxlite
Length of output: 50375
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== stress_disk outline =="
ast-grep outline src/cli/tests/stress_disk.rs --items all
echo "== stress_disk relevant sections =="
sed -n '1,120p' src/cli/tests/stress_disk.rs
sed -n '600,745p' src/cli/tests/stress_disk.rs
echo "== non-vendor /tmp-related source references =="
rg -n -i --glob '!src/deps/**' --glob '!src/cli/tests/e2fsprogs/**' -C 3 'tmpfs|/tmp|/tmpfs|mnt|mount|rootfs|filesystem|overlay' src || true
echo "== focused e2fsprogs tmpfs mentions (if any) =="
rg -n -i 'tmpfs|/tmp' src/cli/tests/e2fsprogs src/cli/tests/stress_disk.rs || trueRepository: boxlite-ai/boxlite
Length of output: 50377
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== stress_disk.rs outline =="
ast-grep outline src/cli/tests/stress_disk.rs --items all || true
echo "== stress_disk.rs top and target section =="
sed -n '1,100p' src/cli/tests/stress_disk.rs
sed -n '600,745p' src/cli/tests/stress_disk.rs
echo "== target code with /tmp and ENOSPC refs only =="
rg -n -i --glob '!src/deps/**' -C 4 'fill\.done|fill\.out|/tmp|ENOSPC|fill\.\$i|while dd|touch|assert' src/cli/tests/stress_disk.rs src || trueRepository: boxlite-ai/boxlite
Length of output: 50377
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== exact stress_disk.rs files =="
fd -a 'stress_disk\.rs$' . || true
echo "== git status/stat for stress_disk.rs =="
git status --short
git diff --stat HEAD src/cli/tests/stress_disk.rs || true
echo "== stress_disk.rs target excerpt, line exact =="
awk '1' src/cli/tests/stress_disk.rs | sed -n '600,745p'
echo "== /tmp mentions in src/cli/tests/stress_disk.rs excluding non-matches =="
rg -n -C 4 'fill\.done|fill\.out|/tmp|ENOSPC|while dd|touch|assert' src/cli/tests/stress_disk.rs || true
echo "== candidate mount setup in src/cli/tests for recent code =="
rg -n -C 3 --glob 'src/cli/tests/**' 'mount|--tmpfs|tmpfs|/tmp|filesystem|overlay' src/cli/tests src/boxlite/src/cli src/boxlite/src/runtime src/boxlite/src/fs src/boxlite/src/litebox src/boxlite/src/vmm src/boxlite/src/disk 2>/dev/null | head -n 400 || trueRepository: boxlite-ai/boxlite
Length of output: 50374
Keep fill status reporting outside the bounded rootfs.
/tmp is checked in the tests as a separate tmpfs, but this script uses it for the completion marker and dd output as well. If /tmp has any allocation limit, dd can exhaust space before writing /tmp/fill.out or creating /tmp/fill.done, making the poll loop time out even though rootfs ENOSPC was hit. Use a guest tmpfs/ramfs path with a generous cap or another non-consumable completion channel.
Also applies to: 676-727
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/cli/tests/stress_disk.rs` around lines 658 - 661, Move the fill-test
status artifacts currently written to /tmp— including fill.out and fill.done in
the script around the fill loop and the corresponding paths through the
additionally affected cases—onto a guest tmpfs/ramfs location with a generous
independent capacity, or use another completion channel outside the bounded
rootfs. Update all writers, pollers, cleanup commands, and references
consistently so rootfs exhaustion cannot prevent status reporting.
Keep CLI integration assertions focused on portable behavior instead of Linux-only permissions or host performance.
Test plan:
Summary by CodeRabbit