From b124ebe53e19a38c8eeb6ef5da442b23b5130e25 Mon Sep 17 00:00:00 2001 From: Victor Toso Date: Fri, 4 Oct 2019 15:26:09 +0200 Subject: [PATCH] migrate.py: fix events race Currently, when we run migrate.py with --client option we get stuck waiting for SPICE_CONNECTED event on target qmp (while receiving only QMP). Problem is, only after event SPICE_INITIALIZED in the source qmp is that the client will be able to do migration (to properly exchange spice messages). So, it is a must that if we have a test where a client is connected, to wait for SPICE_INITIALIZED event in the source qmp. To clarify, this patches fixes the following test: ./migrate.py --client spicy Signed-off-by: Victor Toso Acked-by: Kevin Pouget --- tests/migrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/migrate.py b/tests/migrate.py index a0739ba3..a172c060 100755 --- a/tests/migrate.py +++ b/tests/migrate.py @@ -209,7 +209,7 @@ class Migrator(object): raw_input() # Tester can launch its own client or we wait start_client() to connect - if wait_user_connect: + if self.connected_client or wait_user_connect: wait_for_event(self.active.qmp, 'SPICE_INITIALIZED') self.active.qmp.cmd('client_migrate_info', {'protocol':'spice',