[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: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] runner: Kill a program under test by time-out |
Date: |
Mon, 18 Aug 2014 14:02:45 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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?
Stefan
pgpmXdj3pOqwL.pgp
Description: PGP signature