Skip to content

remote-worker: vmpool test follow-ups from the #647 review (host-memory no-eviction, single-batch eviction, parser seams) #649

Closed

Description

@pdettori

Summary

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

  1. 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.

  2. 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.

  3. Parser seams — no direct tests for:

    • readMemoryCurrent (remote-worker/internal/vmpool/cgroup.go:386)
    • readHostMemAvailable (remote-worker/internal/vmpool/hostmem.go:64)
    • chvScopeCgroupDir (remote-worker/internal/vmpool/launcher_chv.go:1177)

    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.

Refs #644, review on #647.

Activity

  1. added this to the v0.11.0 milestone on Nov 17, 2026
  2. self-assigned this
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions