Skip to content

Commit 29f66dd

Browse files
roypatbchalios
authored andcommitted
chore(test): remove unneeded wait_for_up calls
`wait_for_up`s were replaced with ``` grep -rl wait_for_up tests/integration_tests/ \ |xargs sed '/wait_for_up/d' -i ``` Signed-off-by: Patrick Roy <[email protected]>
1 parent 2cf63c6 commit 29f66dd

22 files changed

+0
-69
lines changed

tests/integration_tests/functional/test_api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def test_drive_io_engine(uvm_plain):
8383
test_microvm.api.drive.put(**kwargs)
8484

8585
test_microvm.start()
86-
test_microvm.wait_for_up()
8786

8887
assert test_microvm.api.vm_config.get().json()["drives"][0]["io_engine"] == "Sync"
8988

@@ -1166,7 +1165,6 @@ def test_get_full_config_after_restoring_snapshot(microvm_factory, uvm_nano):
11661165
}
11671166
]
11681167

1169-
uvm_nano.wait_for_up()
11701168
snapshot = uvm_nano.snapshot_full()
11711169
uvm2 = microvm_factory.build()
11721170
uvm2.spawn()

tests/integration_tests/functional/test_balloon.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ def test_rss_memory_lower(uvm_plain_any):
129129

130130
# Start the microvm.
131131
test_microvm.start()
132-
test_microvm.wait_for_up()
133132

134133
_test_rss_memory_lower(test_microvm)
135134

@@ -151,7 +150,6 @@ def test_inflate_reduces_free(uvm_plain_any):
151150

152151
# Start the microvm
153152
test_microvm.start()
154-
test_microvm.wait_for_up()
155153
firecracker_pid = test_microvm.firecracker_pid
156154

157155
# Get the free memory before ballooning.
@@ -198,7 +196,6 @@ def test_deflate_on_oom(uvm_plain_any, deflate_on_oom):
198196

199197
# Start the microvm.
200198
test_microvm.start()
201-
test_microvm.wait_for_up()
202199
firecracker_pid = test_microvm.firecracker_pid
203200

204201
# We get an initial reading of the RSS, then calculate the amount
@@ -243,7 +240,6 @@ def test_reinflate_balloon(uvm_plain_any):
243240

244241
# Start the microvm.
245242
test_microvm.start()
246-
test_microvm.wait_for_up()
247243
firecracker_pid = test_microvm.firecracker_pid
248244

249245
# First inflate the balloon to free up the uncertain amount of memory
@@ -303,7 +299,6 @@ def test_size_reduction(uvm_plain_any):
303299

304300
# Start the microvm.
305301
test_microvm.start()
306-
test_microvm.wait_for_up()
307302
firecracker_pid = test_microvm.firecracker_pid
308303

309304
# Check memory usage.
@@ -348,7 +343,6 @@ def test_stats(uvm_plain_any):
348343

349344
# Start the microvm.
350345
test_microvm.start()
351-
test_microvm.wait_for_up()
352346
firecracker_pid = test_microvm.firecracker_pid
353347

354348
# Give Firecracker enough time to poll the stats at least once post-boot
@@ -417,7 +411,6 @@ def test_stats_update(uvm_plain_any):
417411

418412
# Start the microvm.
419413
test_microvm.start()
420-
test_microvm.wait_for_up()
421414
firecracker_pid = test_microvm.firecracker_pid
422415

423416
# Dirty 30MB of pages.
@@ -469,7 +462,6 @@ def test_balloon_snapshot(microvm_factory, guest_kernel, rootfs):
469462
)
470463

471464
vm.start()
472-
vm.wait_for_up()
473465

474466
# Dirty 60MB of pages.
475467
make_guest_dirty_memory(vm.ssh, amount_mib=60)
@@ -496,8 +488,6 @@ def test_balloon_snapshot(microvm_factory, guest_kernel, rootfs):
496488
microvm.spawn()
497489
microvm.restore_from_snapshot(snapshot, resume=True)
498490

499-
microvm.wait_for_up()
500-
501491
# Get the firecracker from snapshot pid, and open an ssh connection.
502492
firecracker_pid = microvm.firecracker_pid
503493

@@ -549,7 +539,6 @@ def test_memory_scrub(microvm_factory, guest_kernel, rootfs):
549539
)
550540

551541
microvm.start()
552-
microvm.wait_for_up()
553542

554543
# Dirty 60MB of pages.
555544
make_guest_dirty_memory(microvm.ssh, amount_mib=60)

tests/integration_tests/functional/test_cmd_line_start.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ def test_config_start_no_api_exit(uvm_plain, vm_config_file):
163163
test_microvm.jailer.extra_args.update({"no-api": None})
164164

165165
test_microvm.spawn() # Start Firecracker and MicroVM
166-
test_microvm.wait_for_up()
167166
test_microvm.ssh.run("reboot") # Exit
168167

169168
test_microvm.mark_killed() # waits for process to terminate
@@ -419,7 +418,6 @@ def test_config_start_and_mmds_with_api(uvm_plain, vm_config_file):
419418

420419
# Network namespace has already been created.
421420
test_microvm.spawn()
422-
test_microvm.wait_for_up()
423421

424422
data_store = {
425423
"latest": {
@@ -478,7 +476,6 @@ def test_with_config_and_metadata_no_api(uvm_plain, vm_config_file, metadata_fil
478476
_configure_network_interface(test_microvm)
479477
test_microvm.jailer.extra_args.update({"no-api": None})
480478
test_microvm.spawn()
481-
test_microvm.wait_for_up()
482479

483480
# Get MMDS version and IPv4 address configured from the file.
484481
version, ipv4_address = _get_optional_fields_from_file(vm_config_file)

tests/integration_tests/functional/test_concurrency.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def launch1():
1919
microvm.basic_config(vcpu_count=1, mem_size_mib=128)
2020
microvm.add_net_iface()
2121
microvm.start()
22-
microvm.wait_for_up()
2322

2423
with ThreadPoolExecutor(max_workers=NO_OF_MICROVMS) as tpe:
2524
for _ in range(NO_OF_MICROVMS):

tests/integration_tests/functional/test_cpu_features.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ def test_cpu_template(uvm_plain_any, cpu_template, microvm_factory):
672672
restored_vm = microvm_factory.build()
673673
restored_vm.spawn()
674674
restored_vm.restore_from_snapshot(snapshot, resume=True)
675-
restored_vm.wait_for_up()
676675
check_masked_features(restored_vm, cpu_template)
677676
check_enabled_features(restored_vm, cpu_template)
678677

tests/integration_tests/functional/test_cpu_features_aarch64.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def test_cpu_features_with_static_template(
113113
restored_vm = microvm_factory.build()
114114
restored_vm.spawn()
115115
restored_vm.restore_from_snapshot(snapshot, resume=True)
116-
restored_vm.wait_for_up()
117116
_check_cpu_features_arm(restored_vm, guest_kv, "v1n1")
118117

119118

@@ -143,5 +142,4 @@ def test_cpu_features_with_custom_template(
143142
restored_vm = microvm_factory.build()
144143
restored_vm.spawn()
145144
restored_vm.restore_from_snapshot(snapshot, resume=True)
146-
restored_vm.wait_for_up()
147145
_check_cpu_features_arm(restored_vm, guest_kv, custom_cpu_template["name"])

tests/integration_tests/functional/test_dirty_pages_in_full_snapshot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def test_dirty_pages_after_full_snapshot(uvm_plain):
1414
uvm.basic_config(mem_size_mib=vm_mem_size, track_dirty_pages=True)
1515
uvm.add_net_iface()
1616
uvm.start()
17-
uvm.wait_for_up()
1817

1918
snap_full = uvm.snapshot_full(vmstate_path="vmstate_full", mem_path="mem_full")
2019
snap_diff = uvm.snapshot_diff(vmstate_path="vmstate_diff", mem_path="mem_diff")

tests/integration_tests/functional/test_drive_vhost_user.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def test_vhost_user_block(microvm_factory, guest_kernel, rootfs_ubuntu_22):
5656
"vhost_user_block", 1, aggr_supported=False
5757
)
5858
vm.start()
59-
vm.wait_for_up()
6059

6160
# Now check that vhost-user-block with rw is last.
6261
# 1-0 means line 1, column 0.
@@ -91,7 +90,6 @@ def test_vhost_user_block_read_write(microvm_factory, guest_kernel, rootfs_ubunt
9190
vm.add_vhost_user_drive("rootfs", rootfs_rw, is_root_device=True)
9291
vm.add_net_iface()
9392
vm.start()
94-
vm.wait_for_up()
9593

9694
# Now check that vhost-user-block with rw is last.
9795
# 1-0 means line 1, column 0.
@@ -120,7 +118,6 @@ def test_vhost_user_block_disconnect(microvm_factory, guest_kernel, rootfs_ubunt
120118
)
121119
vm.add_net_iface()
122120
vm.start()
123-
vm.wait_for_up()
124121

125122
# Killing the backend
126123
vm.disks_vhost_user["rootfs"].kill()
@@ -231,7 +228,6 @@ def test_partuuid_boot(
231228
)
232229
vm.add_net_iface()
233230
vm.start()
234-
vm.wait_for_up()
235231

236232
# Now check that vhost-user-block with rw is last.
237233
# 1-0 means line 1, column 0.
@@ -275,7 +271,6 @@ def test_partuuid_update(microvm_factory, guest_kernel, rootfs_ubuntu_22):
275271
"vhost_user_block", 1, aggr_supported=False
276272
)
277273
vm.start()
278-
vm.wait_for_up()
279274

280275
# Now check that vhost-user-block with rw is last.
281276
# 1-0 means line 1, column 0.

tests/integration_tests/functional/test_mmds.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def _validate_mmds_snapshot(
9494
microvm = microvm_factory.build(**kwargs)
9595
microvm.spawn()
9696
microvm.restore_from_snapshot(snapshot, resume=True)
97-
microvm.wait_for_up()
9897

9998
ssh_connection = microvm.ssh
10099

tests/integration_tests/functional/test_pause_resume.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def test_pause_resume(uvm_nano):
4141
microvm.api.vm.patch(state="Resumed")
4242

4343
microvm.start()
44-
microvm.wait_for_up()
4544

4645
# Pausing the microVM after it's been started is successful.
4746
microvm.api.vm.patch(state="Paused")
@@ -69,14 +68,12 @@ def test_pause_resume(uvm_nano):
6968
microvm.api.vm.patch(state="Resumed")
7069

7170
# Verify guest is active again.
72-
microvm.wait_for_up()
7371

7472
# Resuming the microVM when it is already `Resumed` is allowed
7573
# (microVM remains in the running state).
7674
microvm.api.vm.patch(state="Resumed")
7775

7876
# Verify guest is still active.
79-
microvm.wait_for_up()
8077

8178
microvm.kill()
8279

0 commit comments

Comments
 (0)