[LTP] [PATCH V3] lib: multiply the max_runtime if detect slow kconfigs
Li Wang
liwang@redhat.com
Fri Dec 20 04:59:41 CET 2024
Hi All,
It suddenly occurred to me that we might be on the wrong track in
solving the timeout problem. Because 'max_runtime' is intended to
set the expected runtime for the main part of the test, and is also
used as the loop termination time by tst_remaining_time(). So the
multiplier has a side effect of extending the looping time of many tests.
But our original intention was to avoid test timeouts on slow systems
(e.g. debug kernels), and the timeout is a hard upper bound to prevent
the test from hanging indefinitely due to environmental factors
(e.g., slow systems, kernel debug mode).
So, shouldn't we only target to extend the timeout value?
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -555,9 +555,6 @@ static int multiply_runtime(int max_runtime)
parse_mul(&runtime_mul, "LTP_RUNTIME_MUL", 0.0099, 100);
- if (tst_has_slow_kconfig())
- max_runtime *= 4;
-
return max_runtime * runtime_mul;
}
@@ -1706,6 +1703,9 @@ unsigned int tst_multiply_timeout(unsigned int
timeout)
if (timeout < 1)
tst_brk(TBROK, "timeout must to be >= 1! (%d)", timeout);
+ if (tst_has_slow_kconfig())
+ timeout *= 4;
+
return timeout * timeout_mul;
}
--
Regards,
Li Wang
More information about the ltp
mailing list