mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
iotests.py: Let wait_migration wait even more
The "migration completed" event may be sent (on the source, to be specific) before the migration is actually completed, so the VM runstate will still be "finish-migrate" instead of "postmigrate". So ask the users of VM.wait_migration() to specify the final runstate they desire and then poll the VM until it has reached that state. (This should be over very quickly, so busy polling is fine.) Without this patch, I see intermittent failures in the new iotest 280 under high system load. I have not yet seen such failures with other iotests that use VM.wait_migration() and query-status afterwards, but maybe they just occur even more rarely, or it is because they also wait on the destination VM to be running. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
105b07f1ba
commit
8da7969bd7
4 changed files with 12 additions and 8 deletions
|
@ -69,9 +69,9 @@ with iotests.FilePath('img') as img_path, \
|
|||
iotests.log(vm_a.qmp('migrate', uri='exec:cat >%s' % (fifo_a)))
|
||||
with iotests.Timeout(3, 'Migration does not complete'):
|
||||
# Wait for the source first (which includes setup=setup)
|
||||
vm_a.wait_migration()
|
||||
vm_a.wait_migration('postmigrate')
|
||||
# Wait for the destination second (which does not)
|
||||
vm_b.wait_migration()
|
||||
vm_b.wait_migration('running')
|
||||
|
||||
iotests.log(vm_a.qmp('query-migrate')['return']['status'])
|
||||
iotests.log(vm_b.qmp('query-migrate')['return']['status'])
|
||||
|
@ -98,9 +98,9 @@ with iotests.FilePath('img') as img_path, \
|
|||
iotests.log(vm_b.qmp('migrate', uri='exec:cat >%s' % (fifo_b)))
|
||||
with iotests.Timeout(3, 'Migration does not complete'):
|
||||
# Wait for the source first (which includes setup=setup)
|
||||
vm_b.wait_migration()
|
||||
vm_b.wait_migration('postmigrate')
|
||||
# Wait for the destination second (which does not)
|
||||
vm_a.wait_migration()
|
||||
vm_a.wait_migration('running')
|
||||
|
||||
iotests.log(vm_a.qmp('query-migrate')['return']['status'])
|
||||
iotests.log(vm_b.qmp('query-migrate')['return']['status'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue