[PATCH v2 0/6] tests/qtest: make migration-test massively faster

Daniel P. Berrangé posted 6 patches 1 year ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230421171411.566300-1-berrange@redhat.com
Maintainers: John Snow <jsnow@redhat.com>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Juan Quintela <quintela@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Zhang Chen <chen.zhang@intel.com>, Li Zhijian <lizhijian@fujitsu.com>, Stefan Hajnoczi <stefanha@redhat.com>
There is a newer version of this series
tests/qtest/ahci-test.c              |  31 ++--
tests/qtest/boot-order-test.c        |   5 +-
tests/qtest/fdc-test.c               |  15 +-
tests/qtest/ide-test.c               |   5 +-
tests/qtest/migration-helpers.c      |  12 +-
tests/qtest/migration-helpers.h      |   1 +
tests/qtest/migration-test.c         | 252 +++++++++++++++++++--------
tests/qtest/test-filter-mirror.c     |   5 +-
tests/qtest/test-filter-redirector.c |   7 +-
tests/qtest/virtio-blk-test.c        |  24 +--
10 files changed, 227 insertions(+), 130 deletions(-)
[PATCH v2 0/6] tests/qtest: make migration-test massively faster
Posted by Daniel P. Berrangé 1 year ago
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 tests which do still run in live mode all want to guarantee there
are at least 2 iterations of migration, to exercise the dirty page
handling code. This is achieved by running the 1 iteration with an
incredibly small bandwidth and max downtime to prevent convergance,
and watching query-migrate for the reported iteration to increment.
This guarantees that all the tests take at least 30 seconds to run.

Watching for the iteration counter to flip is inefficient and not
actually needed. Instead we merely need to prove that some amount
of already transferred data has been made dirty again. This in turn
will guarantee that a further iteration is required beyond the current
one. This proof is easy to achieve by monitoring the values at two
distinct addresses in guest RAM, and can cut the 30 second duration
down to 1 second.

After this optimization, and Juan's patch to disable autoconverge
testnig, the migration test runs in merely 1 minute which I think
it pretty impressive given the number of scenarios we're testing.

Daniel P. Berrangé (5):
  tests/qtest: replace qmp_discard_response with
    qtest_qmp_assert_success
  tests/qtests: remove migration test iterations config
  tests/qtest: capture RESUME events during migration
  tests/qtest: make more migration pre-copy scenarios run non-live
  tests/qtest: massively speed up migration-tet

Juan Quintela (1):
  tests/migration: Only run auto_converge in slow mode

 tests/qtest/ahci-test.c              |  31 ++--
 tests/qtest/boot-order-test.c        |   5 +-
 tests/qtest/fdc-test.c               |  15 +-
 tests/qtest/ide-test.c               |   5 +-
 tests/qtest/migration-helpers.c      |  12 +-
 tests/qtest/migration-helpers.h      |   1 +
 tests/qtest/migration-test.c         | 252 +++++++++++++++++++--------
 tests/qtest/test-filter-mirror.c     |   5 +-
 tests/qtest/test-filter-redirector.c |   7 +-
 tests/qtest/virtio-blk-test.c        |  24 +--
 10 files changed, 227 insertions(+), 130 deletions(-)

-- 
2.40.0