qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	qemu-block@nongnu.org, Hanna Reitz <hreitz@redhat.com>,
	Cleber Rosa <crosa@redhat.com>, John Snow <jsnow@redhat.com>
Subject: [PATCH v4 6/8] iotests/300: avoid abnormal shutdown race condition
Date: Wed, 13 Oct 2021 17:57:46 -0400	[thread overview]
Message-ID: <20211013215748.2154908-7-jsnow@redhat.com> (raw)
In-Reply-To: <20211013215748.2154908-1-jsnow@redhat.com>

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



  parent reply	other threads:[~2021-10-13 21:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13 21:57 [PATCH v4 0/8] Switch iotests to using Async QMP John Snow
2021-10-13 21:57 ` [PATCH v4 1/8] python/machine: remove has_quit argument John Snow
2021-10-13 21:57 ` [PATCH v4 2/8] python/machine: Handle QMP errors on close more meticulously John Snow
2021-10-13 21:57 ` [PATCH v4 3/8] python/aqmp: Remove scary message John Snow
2021-10-13 21:57 ` [PATCH v4 4/8] iotests: Accommodate async QMP Exception classes John Snow
2021-10-13 21:57 ` [PATCH v4 5/8] iotests: Conditionally silence certain AQMP errors John Snow
2021-10-13 21:57 ` John Snow [this message]
2021-10-14 17:06   ` [PATCH v4 6/8] iotests/300: avoid abnormal shutdown race condition Vladimir Sementsov-Ogievskiy
2021-10-25 12:10   ` Hanna Reitz
2021-10-25 13:20   ` Hanna Reitz
2021-10-26 17:07     ` John Snow
2021-10-27  7:44       ` Hanna Reitz
2021-10-13 21:57 ` [PATCH v4 7/8] python/aqmp: Create sync QMP wrapper for iotests John Snow
2021-10-13 21:57 ` [PATCH v4 8/8] python, iotests: replace qmp with aqmp John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211013215748.2154908-7-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).