aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-10-26 13:56:10 -0400
committerJohn Snow <jsnow@redhat.com>2021-11-01 11:54:59 -0400
commit8f05aee5333a78e2244008021f72e7b21fdc147f (patch)
tree980e42150ced3118f3851e6dc1bb488308de00c7 /tests
parent206dc475484c198d2bbfaf2aacb7bc370a734277 (diff)
iotests/300: avoid abnormal shutdown race condition
Wait for the destination VM to close itself instead of racing to shut it down first, which produces different error log messages from AQMP depending on precisely when we tried to shut it down. (For example: We may try to issue 'quit' immediately prior to the target VM closing its QMP socket, which will cause an ECONNRESET error to be logged. Waiting for the VM to exit itself avoids the race on shutdown behavior.) Reported-by: Hanna Reitz <hreitz@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Message-id: 20211026175612.4127598-7-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/qemu-iotests/30013
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/qemu-iotests/300 b/tests/qemu-iotests/300
index 10f9f2a8da..dbd28384ec 100755
--- a/tests/qemu-iotests/300
+++ b/tests/qemu-iotests/300
@@ -24,8 +24,6 @@ import random
import re
from typing import Dict, List, Optional
-from qemu.machine import machine
-
import iotests
@@ -461,12 +459,11 @@ class TestBlockBitmapMappingErrors(TestDirtyBitmapMigration):
f"'{self.src_node_name}': Name is longer than 255 bytes",
log)
- # Expect abnormal shutdown of the destination VM because of
- # the failed migration
- try:
- self.vm_b.shutdown()
- except machine.AbnormalShutdown:
- pass
+ # Destination VM will terminate w/ error of its own accord
+ # due to the failed migration.
+ self.vm_b.wait()
+ rc = self.vm_b.exitcode()
+ assert rc is not None and rc > 0
def test_aliased_bitmap_name_too_long(self) -> None:
# Longer than the maximum for bitmap names