[LTP] [PATCH v3 22/29] fuzzy_sync: Convert to runtime

Li Wang liwang@redhat.com
Wed May 18 09:47:37 CEST 2022


Li Wang <liwang@redhat.com> wrote:


> Cyril Hrubis <chrubis@suse.cz> wrote:
>
>
>>
>> > Or each test case (defined by tcnt) could be given an equal share of the
>> > runtime?
>>
>> That would be solution as well. If everyone agrees on this I will go
>> with this version, it should be as easy as:
>>
>> diff --git a/lib/tst_test.c b/lib/tst_test.c
>> index dad8aad92..69d7799c3 100644
>> --- a/lib/tst_test.c
>> +++ b/lib/tst_test.c
>> @@ -1349,6 +1349,8 @@ static void run_tests(void)
>>
>>                 if (results_equal(&saved_results, results))
>>                         tst_brk(TBROK, "Test %i haven't reported
>> results!", i);
>> +
>> +               kill(getppid(), SIGUSR1);
>>
>
> I have to say NO here.
>
> This is only reset timeout for each test, the problem we're encountered
> is the max_runtime exhausting, we have to reset 'results->max_runtime'
> but not .timeout.
>

Okay, my perspective is shortsighted as well.

This solution is correct in the direction but overlooks the significant
global value 'tst_start_time'. If that value reflush within tcnt loop we
don't need to reset max_runtime again, actually the real work in my
previous patch is to invoke heartbeat() which touches tst_start_time.

So I would suggest using heartbeat() instead of only sending SIGUSR1
to lib_pid. Or, do simply revision like:

--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1349,6 +1349,10 @@ static void run_tests(void)

                if (results_equal(&saved_results, results))
                        tst_brk(TBROK, "Test %i haven't reported results!",
i);
+
+               if (tst_clock_gettime(CLOCK_MONOTONIC, &tst_start_time))
+                       tst_res(TWARN | TERRNO, "tst_clock_gettime()
failed");
+               kill(getppid(), SIGUSR1);
        }
 }


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


More information about the ltp mailing list