-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Currently, a test can leave a VM snapshot of a running VM behind (disk+RAM snapshot).
This has the advantage of it being quickly reused by subsequent test re-runs or runs of other tests, but there are several issues:
- If somebody starts up the VM using
./contest-sshvm
, it desyncs (corrupts) both the disk and RAM snapshot, which a subsequent test rerun might not catch - It requires re-reading (re-discovering) IP address of the VM in a new test with a fresh
class Guest
instance - It might break SSH if a test tries to run (reuse the snapshot) after
NETWORK_EXPIRY
hours (7 days)
But mainly, keeping the snapshot around is probably not good design - it keeps the VM in a "fragile" unstable state, which is also a problem for CONTEST_LEAVE_GUEST_RUNNING
.
A better solution would be to always keep the VM shut down and without snapshots, but installed-and-ready, between tests.
A test could the easily
- boot the VM up (1min?)
- wait for boot to settle (30sec?)
- Create a persistent ssh connection using
ControlMaster
- create a disk+RAM snapshot
- do testing by (perhaps repeatedly) restoring the snapshot, using the persistent ssh connection
- destroy / remove the disk and RAM snapshots
This would also allow hand-tuning of the VM environment for debugging - the test would always re-use an installed VM (given the right tag, eg. Guest()
argument), so a human can add some debug/monitoring before rerunning the test. Kind of like manually set-up CONTEST_CONTENT
with hand-merged PRs, etc.