Reduce test wall-clock time without weakening coverage#309
Merged
Conversation
Wait for the native helper child before canceling so the regression always exercises process-group termination. Also apply the two clarity cleanups found during self-review.
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
Medium Risk
Production snapshot compression cancellation behavior changes (process-group kill); delete graceful-shutdown skipping is test-only but lives on the shared delete path.
Overview
Cuts integration test wall-clock by attacking repeated setup and teardown overhead, without dropping scenarios or assertions.
Prewarm builds VM-ready images once per CI run:
test-prewarmnow runsCreateImage+WaitForReadyfor each mirrored image, andEnsureImageReadyprefersHYPEMAN_TEST_PREWARM_DIRso tests seed from that cache instead of rebuilding layers. Linux CI chowns the prewarm directory so the job user can write under/ci/prewarm.Faster test VM teardown:
deleteInstanceWithOptionsgainsskipGracefulShutdown;deleteTestInstanceNowuses it for cleanups while publicDeleteInstancebehavior is unchanged.Smaller default lifecycle guests: many integration tests use
lifecycleTestMemorySize(512 MiB) where memory size is not the subject; capacity-focused tests keep larger sizes.Compression cancel fix (production): native zstd/lz4 helpers run in a process group and get SIGKILL on the whole group when the context is canceled, so
Waitdoes not hang on orphaned children; the regression test now requires cancellation within one second.Reviewed by Cursor Bugbot for commit de5fe4f. Bugbot is set up for automated code reviews on this repo. Configure here.