[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 6/8] iotests/300: avoid abnormal shutdown race condition
From: |
John Snow |
Subject: |
[PATCH v4 6/8] iotests/300: avoid abnormal shutdown race condition |
Date: |
Wed, 13 Oct 2021 17:57:46 -0400 |
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>
---
tests/qemu-iotests/300 | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/tests/qemu-iotests/300 b/tests/qemu-iotests/300
index 10f9f2a8da6..bbea7248005 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,10 @@ 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()
+ assert self.vm_b.exitcode() > 0
def test_aliased_bitmap_name_too_long(self) -> None:
# Longer than the maximum for bitmap names
--
2.31.1
- [PATCH v4 0/8] Switch iotests to using Async QMP, John Snow, 2021/10/13
- [PATCH v4 2/8] python/machine: Handle QMP errors on close more meticulously, John Snow, 2021/10/13
- [PATCH v4 4/8] iotests: Accommodate async QMP Exception classes, John Snow, 2021/10/13
- [PATCH v4 3/8] python/aqmp: Remove scary message, John Snow, 2021/10/13
- [PATCH v4 1/8] python/machine: remove has_quit argument, John Snow, 2021/10/13
- [PATCH v4 5/8] iotests: Conditionally silence certain AQMP errors, John Snow, 2021/10/13
- [PATCH v4 8/8] python, iotests: replace qmp with aqmp, John Snow, 2021/10/13
- [PATCH v4 7/8] python/aqmp: Create sync QMP wrapper for iotests, John Snow, 2021/10/13
- [PATCH v4 6/8] iotests/300: avoid abnormal shutdown race condition,
John Snow <=