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é <[email protected]>
> ---
>  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 <[email protected]>

Regards,
Pierrick

Reply via email to