[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] runner: Kill a program under test by time-o
From: |
M.Kustova |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] runner: Kill a program under test by time-out |
Date: |
Mon, 18 Aug 2014 18:42:27 +0400 |
On Mon, Aug 18, 2014 at 5:02 PM, Stefan Hajnoczi <address@hidden> wrote:
> On Fri, Aug 15, 2014 at 05:55:49PM +0400, Maria Kustova wrote:
>> Signed-off-by: Maria Kustova <address@hidden>
>> ---
>> tests/image-fuzzer/runner.py | 29 +++++++++++++++++++++++++----
>> 1 file changed, 25 insertions(+), 4 deletions(-)
>>
>> diff --git a/tests/image-fuzzer/runner.py b/tests/image-fuzzer/runner.py
>> index 688d470..4399529 100755
>> --- a/tests/image-fuzzer/runner.py
>> +++ b/tests/image-fuzzer/runner.py
>> @@ -65,14 +65,35 @@ def run_app(fd, q_args):
>> """Start an application with specified arguments and return its exit
>> code
>> or kill signal depending on the result of execution.
>> """
>> +
>> + class Alarm(Exception):
>> + """Exception for signal.alarm events."""
>> + pass
>> +
>> + def handler(*arg):
>> + """Notify that an alarm event occurred."""
>> + raise Alarm
>> +
>> + signal.signal(signal.SIGALRM, handler)
>> + signal.alarm(300)
>
> What is the purpose of this patch?
>
> The hardcoded 5-minute timeout suggests you're trying to catch runaway
> processes. So this has nothing to do with the new --duration option?
Yes, this patch doesn't relate to the implementation of the '--duration' option.
It helps to mark hung tests as failed.
Maria