From 8dd4c92ee56c34f97869ec05ba60c034e9fad1d5 Mon Sep 17 00:00:00 2001 From: fbalak Date: Wed, 19 Jun 2024 10:24:42 +0200 Subject: [PATCH] Fix rerun_filter for ignore_next_measurement_file Signed-off-by: fbalak --- ocs_ci/utility/workloadfixture.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ocs_ci/utility/workloadfixture.py b/ocs_ci/utility/workloadfixture.py index 279a1329a5d..c4c78fe675f 100644 --- a/ocs_ci/utility/workloadfixture.py +++ b/ocs_ci/utility/workloadfixture.py @@ -187,11 +187,25 @@ def measure_operation( return results -def ignore_next_measurement_file(): +def ignore_next_measurement_file(err, name, test, plugin): """ Sets config.RUN["ignore_next_measurement_file"] to True. This is supposed to be used in monitoring tests that are marked as @flaky to make sure that the measurement is done again. + + Reference to the description of flaky rerun_filter function:: + https://github.com/box/flaky/blob/d29ca76d5a72845428a0716c74f8fa0d40d98532/flaky/flaky_decorator.py#L16 + + Args: + err (`tuple` of `class`, :class:`Exception`, `traceback`): + Information about the test failure (from sys.exc_info()) + name (`unicode`): + The test name + test (:class:`Function`): + The test that has raised an error + plugin (:class:`FlakyPytestPlugin`): + The flaky plugin. Has a :prop:`stream` that can be written to in + order to add to the Flaky Report. """ config.RUN["ignore_next_measurement_file"] = True return True