diff --git a/tests/integration_tests/functional/test_vsock.py b/tests/integration_tests/functional/test_vsock.py index 104fbada886..29323feddf4 100644 --- a/tests/integration_tests/functional/test_vsock.py +++ b/tests/integration_tests/functional/test_vsock.py @@ -187,13 +187,11 @@ def test_vsock_transport_reset_h2g( # it shouldn't receive anything. worker.sock.settimeout(0.25) response = worker.sock.recv(32) - if response != b"": - # If we reach here, it means the connection did not close. - assert False, "Connection not closed: response recieved '{}'".format( - response.decode("utf-8") - ) + assert ( + response == b"" + ), f"Connection not closed: response recieved '{response.decode('utf-8')}'" except (SocketTimeout, ConnectionResetError, BrokenPipeError): - assert True + pass # Terminate VM. metrics = test_vm.flush_metrics() diff --git a/tests/integration_tests/performance/test_huge_pages.py b/tests/integration_tests/performance/test_huge_pages.py index ff13097a9db..034ee6749a0 100644 --- a/tests/integration_tests/performance/test_huge_pages.py +++ b/tests/integration_tests/performance/test_huge_pages.py @@ -128,8 +128,7 @@ def test_hugetlbfs_diff_snapshot(microvm_factory, uvm_plain, uffd_handler_paths) uvm_plain.resume() # Run command to dirty some pages - rc, _, _ = uvm_plain.ssh.run("sync") - assert not rc + uvm_plain.ssh.check_output("sync") snapshot_diff = uvm_plain.snapshot_diff() snapshot_merged = snapshot_diff.rebase_snapshot(base_snapshot) @@ -181,13 +180,11 @@ def test_ept_violation_count( # Wait for microvm to boot. Then spawn fast_page_fault_helper to setup an environment where we can trigger # a lot of fast_page_faults after restoring the snapshot. - rc, _, _ = vm.ssh.run( + vm.ssh.check_output( "nohup /usr/local/bin/fast_page_fault_helper >/dev/null 2>&1