This makes migration-test faster by observing that most of the pre-copy tests don't need to be doing a live migration. They get sufficient code coverage with the guest CPUs paused.
On my machine this cuts the overall execution time of migration-test by 50% from 15 minutes, down to 8 minutes, without sacrificing any noticeable code coverage. This is still quite slow though. The following are the test timings sorted by speed: /x86_64/migration/auto_converge 68.85 /x86_64/migration/precopy/unix/xbzrle 68.29 /x86_64/migration/postcopy/preempt/tls/psk 36.57 /x86_64/migration/dirty_ring 35.58 /x86_64/migration/precopy/unix/plain 35.56 /x86_64/migration/postcopy/preempt/plain 34.71 /x86_64/migration/postcopy/recovery/plain 34.56 /x86_64/migration/postcopy/tls/psk 34.45 /x86_64/migration/postcopy/preempt/recovery/tls/psk 33.99 /x86_64/migration/postcopy/preempt/recovery/plain 33.99 /x86_64/migration/postcopy/plain 33.78 /x86_64/migration/postcopy/recovery/tls/psk 33.30 /x86_64/migration/multifd/tcp/plain/none 21.12 /x86_64/migration/vcpu_dirty_limit 12.28 /x86_64/migration/multifd/tcp/tls/x509/default-host 2.95 /x86_64/migration/multifd/tcp/tls/x509/allow-anon-client 2.68 /x86_64/migration/multifd/tcp/tls/x509/override-host 2.51 /x86_64/migration/precopy/tcp/tls/x509/default-host 1.52 /x86_64/migration/precopy/unix/tls/x509/override-host 1.49 /x86_64/migration/precopy/unix/tls/psk 1.48 /x86_64/migration/precopy/tcp/tls/psk/match 1.47 /x86_64/migration/multifd/tcp/tls/psk/match 1.35 /x86_64/migration/precopy/tcp/tls/x509/allow-anon-client 1.32 /x86_64/migration/precopy/tcp/tls/x509/override-host 1.27 /x86_64/migration/precopy/tcp/tls/x509/friendly-client 1.27 /x86_64/migration/multifd/tcp/plain/zlib 1.08 /x86_64/migration/precopy/tcp/plain 1.05 /x86_64/migration/fd_proto 1.04 /x86_64/migration/multifd/tcp/tls/psk/mismatch 1.00 /x86_64/migration/multifd/tcp/plain/zstd 0.98 /x86_64/migration/precopy/tcp/tls/x509/hostile-client 0.85 /x86_64/migration/multifd/tcp/tls/x509/mismatch-host 0.79 /x86_64/migration/precopy/tcp/tls/x509/mismatch-host 0.75 /x86_64/migration/precopy/unix/tls/x509/default-host 0.74 /x86_64/migration/precopy/tcp/tls/x509/reject-anon-client 0.71 /x86_64/migration/multifd/tcp/tls/x509/reject-anon-client 0.68 /x86_64/migration/precopy/tcp/tls/psk/mismatch 0.63 /x86_64/migration/validate_uuid_src_not_set 0.59 /x86_64/migration/validate_uuid 0.54 /x86_64/migration/validate_uuid_dst_not_set 0.53 /x86_64/migration/bad_dest 0.41 /x86_64/migration/validate_uuid_error 0.31 The auto-converge and xbzrle tests are top because they both inherantly *need* todo multiple interations in order to exercise the desired code paths. The post-copy tests are all up there because we always do one iteration of pre-copy before switching to post-copy and we need to ensure that we don't complete before getting to the post-copy bit. I think we can optimize the post-copy bit though. Only 1 of the post-copy tests really needs to go through a full pre-copy iteration to get good code coverage. For the other post-copy tests we can change to let it copy 10 MBs of data in pre-copy mode and then switch to post-copy. Also in commit 1bfc8dde505f1e6a92697c52aa9b09e81b54c78f Author: Dr. David Alan Gilbert <dgilb...@redhat.com> Date: Mon Mar 6 15:26:12 2023 +0000 tests/migration: Tweek auto converge limits check we cut the bandwidth by factor of x10 to ensure reliability. I think that was perhaps too aggressive. If we bump it back up to say 10 MB/sec that's still better than the original 30 MB/sec, perhaps enough to give us reliability, while cutting time of other tests by 70% Daniel P. Berrangé (2): tests/qtest: capture RESUME events during migration tests/qtest: make more migration pre-copy scenarios run non-live tests/qtest/migration-helpers.c | 12 +++++++++--- tests/qtest/migration-helpers.h | 1 + tests/qtest/migration-test.c | 34 ++++++++++++++++++++++++++------- 3 files changed, 37 insertions(+), 10 deletions(-) -- 2.40.0