iotests: mark 151, 181, 185 & 308 as flaky tests
Introduce a "_flaky_test" function for shell based I/O tests which accepts a GitLab issue URL, and causes the I/O test to be skipped unless the $QEMU_TEST_FLAKY_TESTS environment variable is set. The equivalent "skip_flaky" test decorator is added for python based I/O tests with the same behaviour. This is used by: * Test 151 which fails in QEMU private AWS runners due to failure to make progress in time * Test 181 which fails with a non-responsive QEMU on AWS runners with the QED format * Test 185 which fails in GitLab shared runners * Test 308 which fails to see disk usage increase after fallocate Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel P. Berrangé committed
May 13, 2026 at 11:37 UTC
35d132c69b7fed6f1a0f745db8a844a9bd1a55af
6 files changed
+38
tests/qemu-iotests/151
+1
@@ -308,6 +308,7 @@ class TestThrottledWithNbdExportBase(iotests.QMPTestCase):
308
class TestLowThrottledWithNbdExport(TestThrottledWithNbdExportBase):
309
iops = 16
310
311
+ @iotests.skip_flaky("https://gitlab.com/qemu-project/qemu/-/work_items/3513")
312
def testUnderLoad(self):
313
'''
314
Throttle the source node, then issue a whole bunch of external requests
tests/qemu-iotests/181
+2
@@ -48,6 +48,8 @@ _unsupported_fmt qcow vdi vhdx vmdk vpc vvfat parallels
48
_supported_proto generic
49
_supported_os Linux
50
51
+_flaky_test https://gitlab.com/qemu-project/qemu/-/work_items/3515
52
+
53
size=64M
54
_make_test_img $size
55
tests/qemu-iotests/185
+1
@@ -50,6 +50,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
50
_supported_fmt qcow2
51
_supported_proto file
52
_supported_os Linux
53
+_flaky_test https://gitlab.com/qemu-project/qemu/-/issues/3270
54
55
size=$((64 * 1048576))
56
TEST_IMG="${TEST_IMG}.base" _make_test_img $size
tests/qemu-iotests/308
+2
@@ -53,6 +53,8 @@ _supported_proto file # We create the FUSE export manually
53
_supported_os Linux # We need /dev/urandom
54
_require_disk_usage
55
56
+_flaky_test https://gitlab.com/qemu-project/qemu/-/work_items/3514
57
+
58
# $1: Export ID
59
# $2: Options (beyond the node-name and ID)
60
# $3: Expected return value (defaults to 'return')
tests/qemu-iotests/common.rc
+16
@@ -1088,5 +1088,21 @@ _qcow2_dump_header()
1088
fi
1089
}
1090
1091
+# This must be referenced after any _require_ lines, so that
1092
+# test filtering happens first
1093
+_flaky_test()
1094
+{
1095
+ if test -z "$1"
1096
+ then
1097
+ echo "A GitLab issue URL must be provided for a flaky test"
1098
+ exit 1
1099
+ fi
1100
+
1101
+ if test -z "$QEMU_TEST_FLAKY_TESTS"
1102
+ then
1103
+ _notrun "Test is flaky (see $1) and \$QEMU_TEST_FLAKY_TESTS is not set"
1104
+ fi
1105
+}
1106
+
1107
# make sure this script returns success
1108
true
tests/qemu-iotests/iotests.py
+16
@@ -1603,6 +1603,22 @@ def skip_if_user_is_root(func):
1603
return func(*args, **kwargs)
1604
return func_wrapper
1605
1606
+def skip_flaky(bugurl):
1607
+ '''Skip Test Decorator
1608
+ Always skips test due to unreliable design.
1609
+ Requires a bug report URL for historical record.'''
1610
+ def skip_test_decorator(func):
1611
+ def func_wrapper(*args, **kwargs):
1612
+ if os.environ.get("QEMU_TEST_FLAKY_TESTS", None) is None:
1613
+ case_notrun(
1614
+ ('{}: test is flaky (see {}) and $QEMU_TEST_FLAKY_TESTS ' +
1615
+ 'is not set').format(args[0], bugurl))
1616
+ return None
1617
+ else:
1618
+ return func(*args, **kwargs)
1619
+ return func_wrapper
1620
+ return skip_test_decorator
1621
+
1622
# We need to filter out the time taken from the output so that
1623
# qemu-iotest can reliably diff the results against master output,
1624
# and hide skipped tests from the reference output.