[LTP] [PATCH v4 1/2] lib: introduce tst_timeout_remaining()
Cyril Hrubis
chrubis@suse.cz
Thu Aug 30 13:22:47 CEST 2018
Hi!
> I didn't want to do that, because a test might want calculate something
> based on timeout in setup(), for example to find current overall timeout
> value with LTP_TIMEOUT_MUL taken into account.
>
> For that to work, we have to initialize tst_start_time prior to
> tst_test->setup().
Fair enough, also the alarm() in the test library pid is set before we
run the test setup, so if the test setup would take a few seconds we
will be off with the calculation. Although that could be fixed by
calling heartbeat before we run the loop in testrun(), which I guess
should be done anyway. That in turn would allow for your patch to have
the clock_gettime only in the heartbeat function, right?
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list