]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional: Make socat wait longer in migration exec test
authorFabiano Rosas <farosas@suse.de>
Wed, 22 Apr 2026 23:00:01 +0000 (20:00 -0300)
committerFabiano Rosas <farosas@suse.de>
Thu, 23 Apr 2026 15:14:24 +0000 (12:14 -0300)
The migration_with_exec test is failing sporadically for all
architectures due to a race when the destination socat process takes
too long to start listening while the source process is already
issuing connect().

The race is inherent because the exec: migration spawns the
to-be-exec'ed command asynchronously and returns from the
migrate-incoming command. The localhost-only testcase is not
representative of the majority of migrations. In a real scenario
between two different hosts that race wouldn't happen.

Fix the testcase by configuring the source socat command to wait
indefinitely while trying to connect.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260422230001.3168-1-farosas@suse.de
Signed-off-by: Fabiano Rosas <farosas@suse.de>
tests/functional/migration.py

index 144f091ba8aa760a405f6b34d90fd590f7f8f302..3b7674af3b68dd8c35e02626e52661377f1a7c21 100644 (file)
@@ -85,5 +85,5 @@ class MigrationTest(QemuSystemTest):
         with Ports() as ports:
             free_port = self._get_free_port(ports)
             dst_uri = 'exec:socat TCP-LISTEN:%u -' % free_port
-            src_uri = 'exec:socat - TCP:localhost:%u' % free_port
+            src_uri = 'exec:socat - TCP:localhost:%u,forever' % free_port
             self.migrate(dst_uri, src_uri)