qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/2] qemu-iotests: reduce chance


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/2] qemu-iotests: reduce chance of races in 185
Date: Tue, 8 May 2018 09:26:03 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 05/08/2018 08:54 AM, Stefan Hajnoczi wrote:
Commit 8565c3ab537e78f3e69977ec2c609dc9417a806e ("qemu-iotests: fix
185") identified a race condition in a sub-test.

Similar issues also affect the other sub-tests.  If disk I/O completes
quickly, it races with the QMP 'quit' command.  This causes spurious
test failures because QMP events are emitted in an unpredictable order.

This test relies on QEMU internals and there is no QMP API for getting
deterministic behavior needed to make this test 100% reliable.  At the
same time, the test is useful and it would be a shame to remove it.

Add sleep 0.5 to reduce the chance of races.  This is not a real fix but
appears to reduce spurious failures in practice.

Cc: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
  tests/qemu-iotests/185 | 12 ++++++++++++
  1 file changed, 12 insertions(+)

I'm not opposed to this patch, but is there any way to write the test to take both events in either order, without logging the events as they arrive, but instead summarizing in a deterministic order which events were received after the fact? That way, no matter which way the race is won, we merely log that we got two expected events, and could avoid the extra sleep.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]