test(host): cover the disk-size threshold in fetch_host_extend (#721) #762
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.44) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.44 · 214 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.321
Real PR Conversation Timeline
1 comments
"Review active on #762"
general
weight: 0.35
Huang-404-Q
What this adds
Regression tests for #721's disk-size threshold, which landed as a2b4643 with
no test coverage. The fix itself is already on
4.0; this PR only adds tests,rebased onto current
4.0.Two cases, one per probe path in
fetch_host_extend():40GB/512GB.
/proc/partitionsfallback — a 5GB disk and an exactly-10GB disk arecollected, and the partition entry (
sda1) is still filtered out byWHOLE_DISK_REGEX.The exactly-10GB case is the one the old
if size > 10guard dropped in bothpaths, which is why it is asserted explicitly rather than folded into a "small
disk" case.
Verification
Both tests fail against the pre-fix guard and pass against the merged fix —
checked by editing only
apps/host/utils.pyback toif size > 10and runningthem again:
The SSH layer is stubbed (
FakeSSH.exec_command_rawreturns preset output percommand), so no host, database or network is involved.
tests/conftest.pyonlyputs
spug_apionsys.path— the repo ships no test infrastructure, and thesuite is small enough to run with just
Django>=4.2,<4.3installed.Relation to my earlier PR #753
#753 proposed removing the size filter entirely, on the same issue. a2b4643
took the
>= 1form instead and also added the-e 1,7,11device exclusion,which is the better fix — it keeps a floor and stops virtual devices from
eating the ten display slots. I've closed #753 in favour of this; the fixtures
here use the merged
-e 1,7,11command.