[LTP] [PATCH 6/6] lib: Add tst_set_runtime() & remove tst_set_timeout()

Li Wang liwang@redhat.com
Tue Oct 26 08:16:41 CEST 2021


On Tue, Oct 26, 2021 at 12:02 AM Cyril Hrubis <chrubis@suse.cz> wrote:

> Rarely there is a need to set the test runtime dynamically, the only
> tests in LTP that does this are the timer tests that can get two
> parameters, number of iterations and sleep time, and the test runtime is
> close to the multiplication of these two.
>
> It's still cleaner to set the runtime and let the test library figure
> out the timeout in this case.
>

If so, should we consider to hinden the .timeout in struct tst_test
to prevent users from changing it?

IIRC, we currently have ".timeout == -1" to disable test timed
out in unsure situation, e.g some OOM tests. But in this patch,
I saw you remove that, but not handle it in tst_set_runtime.



>
> Also when no parameters are passed to these tests the runtime is a sum
> of multiplications from the tst_timer_test.c source so we define a
> constant in the tst_timer_test.h header and set the max_runtime in the
> testcases accordingly. With this we get correct estimate for the test
> runtime and tighter, but still forgiving enough, timeout as well.
>


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20211026/d0d77e25/attachment.htm>


More information about the ltp mailing list