[PATCH v6 14/16] tests/qemu-iotests: mark 185 as a flaky test

Daniel P. Berrangé posted 16 patches 2 months ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
There is a newer version of this series
[PATCH v6 14/16] tests/qemu-iotests: mark 185 as a flaky test
Posted by Daniel P. Berrangé 2 months ago
Introduce a "_flaky_test" function for 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.

This is used by test 185 which currently fails in GitLab CI for
unknown reasons.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/qemu-iotests/185       |  1 +
 tests/qemu-iotests/common.rc | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/tests/qemu-iotests/185 b/tests/qemu-iotests/185
index 17489fb91c..a62ae8d329 100755
--- a/tests/qemu-iotests/185
+++ b/tests/qemu-iotests/185
@@ -50,6 +50,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto file
 _supported_os Linux
+_flaky_test https://gitlab.com/qemu-project/qemu/-/issues/3270
 
 size=$((64 * 1048576))
 TEST_IMG="${TEST_IMG}.base" _make_test_img $size
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 731e4b2b99..298bc483e0 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -1088,5 +1088,21 @@ _qcow2_dump_header()
     fi
 }
 
+# This must be referenced after any _require_  lines, so that
+# test filtering happens first
+_flaky_test()
+{
+    if test -z "$1"
+    then
+	echo "A GitLab issue URL must be provided for a flaky test"
+	exit 1
+    fi
+
+    if test -z "$QEMU_TEST_FLAKY_TESTS"
+    then
+	_notrun "Test is flaky (see $1) and \$QEMU_TEST_FLAKY_TESTS is not set"
+    fi
+}
+
 # make sure this script returns success
 true
-- 
2.54.0


Re: [PATCH v6 14/16] tests/qemu-iotests: mark 185 as a flaky test
Posted by Pierrick Bouvier 2 months ago
On 5/13/2026 5:00 AM, Daniel P. Berrangé wrote:
> Introduce a "_flaky_test" function for 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.
> 
> This is used by test 185 which currently fails in GitLab CI for
> unknown reasons.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  tests/qemu-iotests/185       |  1 +
>  tests/qemu-iotests/common.rc | 16 ++++++++++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/tests/qemu-iotests/185 b/tests/qemu-iotests/185
> index 17489fb91c..a62ae8d329 100755
> --- a/tests/qemu-iotests/185
> +++ b/tests/qemu-iotests/185
> @@ -50,6 +50,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>  _supported_fmt qcow2
>  _supported_proto file
>  _supported_os Linux
> +_flaky_test https://gitlab.com/qemu-project/qemu/-/issues/3270
>  
>  size=$((64 * 1048576))
>  TEST_IMG="${TEST_IMG}.base" _make_test_img $size
> diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
> index 731e4b2b99..298bc483e0 100644
> --- a/tests/qemu-iotests/common.rc
> +++ b/tests/qemu-iotests/common.rc
> @@ -1088,5 +1088,21 @@ _qcow2_dump_header()
>      fi
>  }
>  
> +# This must be referenced after any _require_  lines, so that
> +# test filtering happens first
> +_flaky_test()
> +{
> +    if test -z "$1"
> +    then
> +	echo "A GitLab issue URL must be provided for a flaky test"
> +	exit 1
> +    fi
> +
> +    if test -z "$QEMU_TEST_FLAKY_TESTS"
> +    then
> +	_notrun "Test is flaky (see $1) and \$QEMU_TEST_FLAKY_TESTS is not set"
> +    fi
> +}
> +
>  # make sure this script returns success
>  true

This looks better than first approach, thanks.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>

Regards,
Pierrick

Re: [PATCH v6 14/16] tests/qemu-iotests: mark 185 as a flaky test
Posted by Thomas Huth 2 months ago
On 13/05/2026 14.00, Daniel P. Berrangé wrote:
> Introduce a "_flaky_test" function for 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.
> 
> This is used by test 185 which currently fails in GitLab CI for
> unknown reasons.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   tests/qemu-iotests/185       |  1 +
>   tests/qemu-iotests/common.rc | 16 ++++++++++++++++
>   2 files changed, 17 insertions(+)
> 
> diff --git a/tests/qemu-iotests/185 b/tests/qemu-iotests/185
> index 17489fb91c..a62ae8d329 100755
> --- a/tests/qemu-iotests/185
> +++ b/tests/qemu-iotests/185
> @@ -50,6 +50,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
>   _supported_fmt qcow2
>   _supported_proto file
>   _supported_os Linux
> +_flaky_test https://gitlab.com/qemu-project/qemu/-/issues/3270
>   
>   size=$((64 * 1048576))
>   TEST_IMG="${TEST_IMG}.base" _make_test_img $size
> diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
> index 731e4b2b99..298bc483e0 100644
> --- a/tests/qemu-iotests/common.rc
> +++ b/tests/qemu-iotests/common.rc
> @@ -1088,5 +1088,21 @@ _qcow2_dump_header()
>       fi
>   }
>   
> +# This must be referenced after any _require_  lines, so that
> +# test filtering happens first
> +_flaky_test()
> +{
> +    if test -z "$1"
> +    then
> +	echo "A GitLab issue URL must be provided for a flaky test"
> +	exit 1
> +    fi
> +
> +    if test -z "$QEMU_TEST_FLAKY_TESTS"
> +    then
> +	_notrun "Test is flaky (see $1) and \$QEMU_TEST_FLAKY_TESTS is not set"
> +    fi
> +}
> +
>   # make sure this script returns success
>   true

Thanks!

Reviewed-by: Thomas Huth <thuth@redhat.com>