Subtests that measure time of resume after engine reset compare a median
value calculated from the measurements against a presumed limit and fail
if the limit has been exceeded.  However, if it occurs not possible to
collect enough measurements required for stable median value calculation,
that condition is now ignored and success is reported, as if the measured
time fit below the limit.

Skip if not able to collect sufficient number of time measurements.  CI
results from slow platforms that always skip may be handled as expected
skips.

v3: Use a symbol for minimum number of measurements (Kamil),
  - reword skip message for its better readability (Kamil).

Cc: Krzysztof Karas <[email protected]>
Cc: Kamil Konieczny <[email protected]>
Signed-off-by: Janusz Krzysztofik <[email protected]>
---
 tests/intel/gem_eio.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/intel/gem_eio.c b/tests/intel/gem_eio.c
index b65b914faf..35291e759d 100644
--- a/tests/intel/gem_eio.c
+++ b/tests/intel/gem_eio.c
@@ -409,8 +409,10 @@ static void check_wait_elapsed(const char *prefix, int fd, 
igt_stats_t *st)
                 igt_stats_get_median(st)*1e-6,
                 igt_stats_get_max(st)*1e-6);
 
-       if (st->n_values < 9)
-               return; /* too few for stable median */
+#define NUMER_OF_MEASURED_CYCLES_NEEDED 9
+       igt_require_f(st->n_values >= NUMER_OF_MEASURED_CYCLES_NEEDED,
+                     "at least %d completed resets are needed for stable 
median calculation, %d is too few\n",
+                     NUMER_OF_MEASURED_CYCLES_NEEDED, st->n_values);
 
        /*
         * Older platforms need to reset the display (incl. modeset to off,
-- 
2.51.0

Reply via email to