Reduce test wall-clock time without weakening coverage#309
Open
IlyaasK wants to merge 3 commits into
Open
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.
What
Reduce the Hypeman test suite wall-clock time by removing measured lifecycle overhead:
Why
Wall-clock profiling showed that the suite was spending substantial time in repeated image preparation, graceful shutdown timeouts, oversized lifecycle guests, and a cancellation path that killed the shell but left its child process holding output pipes open.
These changes address those root causes directly. They do not shard the suite or add a test matrix.
Result
Linux Run tests step:
The full Linux job, macOS job, and install checks passed.
Test strength
No tests, assertions, VMM backends, or integration scenarios are removed.
Production DeleteInstance behavior remains unchanged. Immediate shutdown is restricted to test cleanup and terminal test teardown. Dedicated memory and resource-capacity tests retain their larger guest sizes.
The compression cancellation regression test also asserts that cancellation returns within one second, so the original 30-second child-process leak cannot silently return.
Verification
Note
Low Risk
Production delete and compression paths change only in ways that fix cancellation leaks; faster teardown and smaller test VMs are confined to tests and CI prewarm.
Overview
This PR targets measured overhead in the integration test suite (~27% faster Linux CI runs) without dropping scenarios or assertions.
CI prewarm now builds each mirrored image to ready disk state in
cmd/test-prewarm(not just registry mirror), and Linux workflowchowns the prewarm dir so the runner can write there.snapshottest.EnsureImageReadyreadsHYPEMAN_TEST_PREWARM_DIR, so tests seed from that cache instead of repeatedly pulling/converting nginx and friends.Test teardown adds
deleteInstanceWithOptionswithskipGracefulShutdownand a test-onlydeleteTestInstanceNowhelper; integration cleanups use it so they skip the delete grace period while productionDeleteInstanceis unchanged.Lifecycle guests that do not need large RAM use
lifecycleTestMemorySize(512 MiB) instead of 1 GiB, shrinking snapshot/standby work. Dedicated memory-capacity tests keep their larger sizes.Snapshot compression native helpers run in a process group and are SIGKILL’d on context cancel, with a regression test that cancellation returns within one second (avoids orphaned
zstdchildren blockingWait).Reviewed by Cursor Bugbot for commit b4d95a4. Bugbot is set up for automated code reviews on this repo. Configure here.