Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/3] testing/infra/emulator: allow to specify pexpect timeout
Date: Wed, 5 Jul 2017 12:57:08 +0200	[thread overview]
Message-ID: <20170705125708.273a3669@windsurf> (raw)
In-Reply-To: <20170704185807.27189-1-andrew.smirnov@gmail.com>

Hello,

First of all, thanks a lot for working on the testing infrastructure.
It's nice to see people progressively making use of it!

I however have one comment below.

On Tue,  4 Jul 2017 11:58:05 -0700, Andrey Smirnov wrote:
> Some commands take more than 5 seconds to complete under QEMU, so add
> provisions to allow individual unit-test to specify different duration
> to avoid false negative test failures.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
>  support/testing/infra/emulator.py | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/support/testing/infra/emulator.py b/support/testing/infra/emulator.py
> index a39d59b..4e988a4 100644
> --- a/support/testing/infra/emulator.py
> +++ b/support/testing/infra/emulator.py
> @@ -26,7 +26,10 @@ class Emulator(object):
>      #
>      # options: array of command line options to pass to Qemu
>      #
> -    def boot(self, arch, kernel=None, kernel_cmdline=None, options=None):
> +    # timeout: timeout to wait for when excuting commands
> +    #
> +    def boot(self, arch, kernel=None, kernel_cmdline=None,
> +             options=None, timeout=5):

I don't really like the fact that the timeout is passed at boot() and
then applies to the entire pexpect session.

Indeed, within a single pexpect session, we may have some commands that
are expected to be short, some commands that are expected to be long.

The .expect() method of the spawn class does have a timeout argument,
so I believe we could do that per-command.

Do you think it would be possible to instead add the timeout to
emulator.run() instead, and use it only when starting the interpreter ?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  parent reply	other threads:[~2017-07-05 10:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 18:58 [Buildroot] [PATCH 1/3] testing/infra/emulator: allow to specify pexpect timeout Andrey Smirnov
2017-07-04 18:58 ` [Buildroot] [PATCH 2/3] testing/tests/package/test_python: refactor to support better code reuse Andrey Smirnov
2017-07-05 10:59   ` Thomas Petazzoni
2017-07-05 21:30     ` Andrey Smirnov
2017-07-05 22:09       ` Arnout Vandecappelle
2017-07-06  7:08         ` Thomas Petazzoni
2017-07-04 18:58 ` [Buildroot] [PATCH 3/3] testing/tests/package: add basic unit test for IPython Andrey Smirnov
2017-07-06  1:29   ` Ricardo Martincoski
2017-07-05 10:57 ` Thomas Petazzoni [this message]
2017-07-05 21:27   ` [Buildroot] [PATCH 1/3] testing/infra/emulator: allow to specify pexpect timeout Andrey Smirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170705125708.273a3669@windsurf \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox