<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Petr, Cyril,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 2, 2021 at 6:26 PM Petr Vorel <<a href="mailto:pvorel@suse.cz" target="_blank">pvorel@suse.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Cyril,<br>
<br>
> Hi!<br>
> > > +tst_set_timeout()<br>
> > > +{<br>
> > > + TST_TIMEOUT="$1"<br>
<br>
<br>
> > Not sure if we should check "$1" is valid again before using it.<br>
<br>
> > I guess in most scenarios, the function is invoked by tests, so<br>
> > just needs to guarantee $1 > $TST_TIMEOUT, otherwise, it<br>
> > looks meaningless to reset TST_TIMEOUT?<br>
> > (especially to avoid people set a smaller value by a typo)<br>
<br>
> I can image where it may make sense to set the timeout smaller than<br>
> default dynamically. If we had a test that consists of many iterations<br>
> whose number depends on the actuall system we run on (the same as the<br>
> supported filesystem) but if the iterations are rather quick we may end<br>
> up in a situation where we run only one iteration and we will attempt to<br>
> set a timeout smaller than default in the setup() which wouldn't be<br>
> wrong.<br>
+1, I couldn't agree more.<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Sounds reasonable. Thanks for the explanation on this.</div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> Hence I would check that the value is greater than zero here instead.<br>
I'd allow also to disable timeout with -1. And the rest of the checks<br>
(i.e. int -1 or > 0) is in _tst_setup_timer().<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Allow setting -1 is good to me.</div></div></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>