@samitouri / QOSamiQemu / commits / b4ec2e8dae

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 <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>

Fabiano Rosas committed Apr 22, 2026 at 20:00 UTC b4ec2e8dae4da74498068536a336fd7424f8446e
1 file changed +1 -1
tests/functional/migration.py
+1 -1
@@ -85,5 +85,5 @@ class MigrationTest(QemuSystemTest):
85 with Ports() as ports:
86 free_port = self._get_free_port(ports)
87 dst_uri = 'exec:socat TCP-LISTEN:%u -' % free_port
88 - src_uri = 'exec:socat - TCP:localhost:%u' % free_port
88 + src_uri = 'exec:socat - TCP:localhost:%u,forever' % free_port
89 self.migrate(dst_uri, src_uri)