Skip to content

Commit 39b9dfa

Browse files
committed
test_5_snapshots: clarify variable usage
Only keep a single "snapshot" variable outside the loop Signed-off-by: Patrick Roy <[email protected]>
1 parent cd8ef82 commit 39b9dfa

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/integration_tests/functional/test_snapshot_basic.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ def test_5_snapshots(
157157
# Create a snapshot from a microvm.
158158
start_guest_echo_server(vm)
159159
snapshot = vm.make_snapshot(snapshot_type)
160-
base_snapshot = snapshot
161160
vm.kill()
162161

163162
for i in range(seq_len):
@@ -183,20 +182,20 @@ def test_5_snapshots(
183182

184183
time.sleep(2)
185184
logger.info("Create snapshot %s #%d.", snapshot_type, i + 1)
186-
snapshot = microvm.make_snapshot(snapshot_type)
185+
new_snapshot = microvm.make_snapshot(snapshot_type)
187186

188187
# If we are testing incremental snapshots we must merge the base with
189188
# current layer.
190189
if snapshot.is_diff:
191-
logger.info("Base: %s, Layer: %s", base_snapshot.mem, snapshot.mem)
192-
snapshot = snapshot.rebase_snapshot(
193-
base_snapshot, use_snapshot_editor=use_snapshot_editor
190+
logger.info("Base: %s, Layer: %s", snapshot.mem, new_snapshot.mem)
191+
new_snapshot = new_snapshot.rebase_snapshot(
192+
snapshot, use_snapshot_editor=use_snapshot_editor
194193
)
195194

196195
microvm.kill()
197196
copied_snapshot.delete()
198197
# Update the base for next iteration.
199-
base_snapshot = snapshot
198+
snapshot = new_snapshot
200199

201200

202201
def test_patch_drive_snapshot(uvm_nano, microvm_factory):

0 commit comments

Comments
 (0)