From: Fabiano Rosas Date: Wed, 22 Apr 2026 23:00:01 +0000 (-0300) Subject: tests/functional: Make socat wait longer in migration exec test X-Git-Tag: v11.1.0-rc0~157^2~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b4ec2e8dae4da74498068536a336fd7424f8446e;p=thirdparty%2Fqemu.git tests/functional: Make socat wait longer in migration exec test 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 Reviewed-by: Peter Xu Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/qemu-devel/20260422230001.3168-1-farosas@suse.de Signed-off-by: Fabiano Rosas --- diff --git a/tests/functional/migration.py b/tests/functional/migration.py index 144f091ba8a..3b7674af3b6 100644 --- a/tests/functional/migration.py +++ b/tests/functional/migration.py @@ -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)