[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 12/20] iotests: Make 136 less flaky
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 12/20] iotests: Make 136 less flaky |
Date: |
Tue, 14 Nov 2017 18:24:09 +0100 |
136 executes some AIO requests without a final aio_flush; then it
advances the virtual clock and thus expects the last access time of the
device to be less than the current time when queried (i.e. idle_time_ns
to be greater than 0). However, without the aio_flush, some requests
may be settled after the clock_step invocation. In that case,
idle_time_ns would be 0 and the test fails.
Fix this by adding an aio_flush if any AIO request other than some other
aio_flush has been executed.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/136 | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/136 b/tests/qemu-iotests/136
index 4b994897af..88b97ea7c6 100644
--- a/tests/qemu-iotests/136
+++ b/tests/qemu-iotests/136
@@ -238,6 +238,18 @@ sector = "%d"
for i in range(failed_wr_ops):
ops.append("aio_write %d 512" % bad_offset)
+ # We need an extra aio_flush to settle all outstanding AIO
+ # operations before we can advance the virtual clock, so that
+ # the last access happens before clock_step and idle_time_ns
+ # will be greater than 0
+ extra_flush = 0
+ if rd_ops + wr_ops + invalid_rd_ops + invalid_wr_ops + \
+ failed_rd_ops + failed_wr_ops > 0:
+ extra_flush = 1
+
+ if extra_flush > 0:
+ ops.append("aio_flush")
+
if failed_wr_ops > 0:
highest_offset = max(highest_offset, bad_offset + 512)
@@ -251,7 +263,7 @@ sector = "%d"
self.total_wr_bytes += wr_ops * wr_size
self.total_wr_ops += wr_ops
self.total_wr_merged += wr_merged
- self.total_flush_ops += flush_ops
+ self.total_flush_ops += flush_ops + extra_flush
self.invalid_rd_ops += invalid_rd_ops
self.invalid_wr_ops += invalid_wr_ops
self.failed_rd_ops += failed_rd_ops
--
2.13.6
- [Qemu-block] [PULL 02/20] qcow2: Prevent allocating L2 tables at offset 0, (continued)
- [Qemu-block] [PULL 02/20] qcow2: Prevent allocating L2 tables at offset 0, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 03/20] qcow2: Prevent allocating compressed clusters at offset 0, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 05/20] qcow2: Add iotest for an image with header.refcount_table_offset == 0, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 04/20] qcow2: Don't open images with header.refcount_table_clusters == 0, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 06/20] qcow2: Add iotest for an empty refcount table, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 07/20] qcow2: Assert that the crypto header does not overlap other metadata, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 08/20] iotests: Make 030 less flaky, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 09/20] iotests: Add missing 'blkdebug::' in 040, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 10/20] iotests: Make 055 less flaky, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 11/20] iotests: Make 083 less flaky, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 12/20] iotests: Make 136 less flaky,
Max Reitz <=
- [Qemu-block] [PULL 13/20] iotests: Use new-style NBD connections, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 14/20] qcow2: Check that corrupted images can be repaired in iotest 060, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 16/20] iotests: 077: Filter out 'resume' lines, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 15/20] block/snapshot: dirty all dirty bitmaps on snapshot-switch, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 17/20] block/vhdx.c: Don't blindly update the header, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 18/20] block/parallels: Do not update header or truncate image when INMIGRATE, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 20/20] qemu-iotests: update unsupported image formats in 194, Max Reitz, 2017/11/14
- [Qemu-block] [PULL 19/20] block/parallels: add migration blocker, Max Reitz, 2017/11/14
- Re: [Qemu-block] [PULL 00/20] Block patches for 2.11.0-rc1, Peter Maydell, 2017/11/14