<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>> wrote:<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-size:small"></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Cyril Hrubis <<a href="mailto:chrubis@suse.cz" target="_blank">chrubis@suse.cz</a>> wrote:<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br>
> Or each test case (defined by tcnt) could be given an equal share of the<br>
> runtime?<br>
<br>
That would be solution as well. If everyone agrees on this I will go<br>
with this version, it should be as easy as:<br>
<br>
diff --git a/lib/tst_test.c b/lib/tst_test.c<br>
index dad8aad92..69d7799c3 100644<br>
--- a/lib/tst_test.c<br>
+++ b/lib/tst_test.c<br>
@@ -1349,6 +1349,8 @@ static void run_tests(void)<br>
<br>
if (results_equal(&saved_results, results))<br>
tst_brk(TBROK, "Test %i haven't reported results!", i);<br>
+<br>
+ kill(getppid(), SIGUSR1);<br></blockquote><div><br></div><div><div style="font-size:small">I have to say NO here.</div><br></div><div><div style="font-size:small">This is only reset timeout for each test, the problem we're encountered<br></div><div style="font-size:small">is the max_runtime exhausting, we have to reset 'results->max_runtime'</div><div style="font-size:small">but not .timeout.</div></div></div></div></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Okay, my perspective is shortsighted as well.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">This solution is correct in the direction but overlooks the significant</div><div class="gmail_default" style="font-size:small">global value 'tst_start_time'. If that value reflush within tcnt loop we</div><div class="gmail_default" style="font-size:small">don't need to reset max_runtime again, actually the real work in my</div><div class="gmail_default" style="font-size:small">previous patch is to invoke heartbeat() which touches tst_start_time.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">So I would suggest using heartbeat() instead of only sending SIGUSR1</div><div class="gmail_default" style="font-size:small">to lib_pid. Or, do simply revision like:</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_default" style="font-size:small">--- a/lib/tst_test.c</div>+++ b/lib/tst_test.c<br>@@ -1349,6 +1349,10 @@ static void run_tests(void)<br> <br> if (results_equal(&saved_results, results))<br> tst_brk(TBROK, "Test %i haven't reported results!", i);<br>+<br>+ if (tst_clock_gettime(CLOCK_MONOTONIC, &tst_start_time))<br>+ tst_res(TWARN | TERRNO, "tst_clock_gettime() failed");<br>+ kill(getppid(), SIGUSR1);<br> }<br> }<div><br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>