e2e: cover firecracker host-memory admission - #216
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Firecracker gets coverage for host-memory admission — the only resource gate the project applies at all.
What was added
t16_insufficient_memory.sh— a deployment asking for 999Ti must be refused with a terminalinsufficient_resourcesstatus, before any work is done.A microVM reserves its whole memory at boot, so an unchecked over-ask fails the spawn with an opaque allocation error and crash-loops, burning a rootfs copy and a TAP on every attempt for RAM that is never coming back.
check_host_memoryprevents that, and it is shared with Cloud Hypervisor — but only CH had a test for it.The assertions go past the status: no Firecracker socket exists, no rootfs image was copied, the count stops moving, and the status does not drift onwards to
crash_loop_back_off. An operator filtering oninsufficient_resourcesneeds it to stay there.A divergence found on the way
Firecracker reaches this state with
restart_count = 5— the over-ask is retried up toMAX_RESTART_COUNTbefore settling. CH'st23comments that the count "must stay 0 (no spawn attempt, no crash loop)" for the same shared code path, but never actually asserts it, so that figure was never verified.Nothing leaks either way (the check fires before any copy or spawn, which this test proves), and the status is terminal on both. So the test pins the real behaviour rather than the documented intent, says so explicitly, and the divergence is tracked on the board for whoever decides which accounting is correct.
Verification
Run locally against a real Firecracker setup. Firecracker e2e coverage: 9 → 16 across this session.