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
remote-worker: vmpool test follow-ups from the #647 review (host-memory no-eviction, single-batch eviction, parser seams) #649
The #647 review (approved) left three test-coverage gaps as non-blocking follow-ups. The behaviors are implemented and documented in comments, but not pinned by tests, so a future refactor could silently drop them.
From the review:
Tests for "no eviction on RefuseHostMemory" (a BudgetEvictions delta of 0 in the host-floor tests), the single-batch property, and parsing for readMemoryCurrent / readHostMemAvailable / chvScopeCgroupDir.
Items
No eviction on RefuseHostMemory — admitOrEvictLocked (remote-worker/internal/vmpool/budget.go) deliberately returns without evicting when the refusal is host-memory: reclaimLoop destroys asynchronously, so MemAvailable is unchanged at the re-admit and burned standbys would not un-refuse the caller. This is documented in comments at both call sites (admission and promotion), but the host-floor tests in standby_charge_test.go should also assert a BudgetEvictions delta of 0 across a host-floor refusal.
Single-batch eviction — evictForAdmissionLocked gathers all victims of one call into a single reclaimBatch, so funding an admission costs one reclaimQ slot regardless of how many standbys it sheds (SBX0-scale funding needs ~129 evictions against a 64-slot queue — the shape that motivated the batching). A many-victim test should pin that the queue gains exactly one batch, not one per VM.
Malformed input, trailing whitespace/newlines, and error paths (unreadable file, absent key) are currently exercised only incidentally through the pool tests.
Acceptance
A host-floor refusal test asserts BudgetEvictions delta 0 (and that the standby population is unchanged).
A many-victim funding test asserts one reclaimBatch per evictForAdmissionLocked call.
Table-driven parsing tests for the three seams, including the fail-safe paths.
Activity