diff mbox

tests/prom-env: Ease time-out problems on slow hosts

Message ID 1486649607-31248-1-git-send-email-thuth@redhat.com
State New
Headers show

Commit Message

Thomas Huth Feb. 9, 2017, 2:13 p.m. UTC
Peter Maydell recently ran into time-out problems with the
prom-env test on a rather slow ARM board. To tackle this issue,
we can speed up the test by running QEMU with "-nodefaults" here,
so that SLOF has less devices to scan during boot, and by using
the "nvramrc" environment variable instead of "boot-command",
since this variable is evaluated earlier in the boot process.
And to be really sure that we do not face such time out problems
again, let's also increase the time out value from 100s to 120s
instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/prom-env-test.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Peter Maydell Feb. 9, 2017, 2:37 p.m. UTC | #1
On 9 February 2017 at 14:13, Thomas Huth <thuth@redhat.com> wrote:
> Peter Maydell recently ran into time-out problems with the
> prom-env test on a rather slow ARM board. To tackle this issue,
> we can speed up the test by running QEMU with "-nodefaults" here,
> so that SLOF has less devices to scan during boot, and by using
> the "nvramrc" environment variable instead of "boot-command",
> since this variable is evaluated earlier in the boot process.
> And to be really sure that we do not face such time out problems
> again, let's also increase the time out value from 100s to 120s
> instead.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/prom-env-test.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Seems to cut the elapsed realtime for the pseries board
down from about 90s to 55s. Hopefully that plus the
boosted timeout will help.

Tested-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
David Gibson Feb. 9, 2017, 11:15 p.m. UTC | #2
On Thu, Feb 09, 2017 at 02:37:26PM +0000, Peter Maydell wrote:
> On 9 February 2017 at 14:13, Thomas Huth <thuth@redhat.com> wrote:
> > Peter Maydell recently ran into time-out problems with the
> > prom-env test on a rather slow ARM board. To tackle this issue,
> > we can speed up the test by running QEMU with "-nodefaults" here,
> > so that SLOF has less devices to scan during boot, and by using
> > the "nvramrc" environment variable instead of "boot-command",
> > since this variable is evaluated earlier in the boot process.
> > And to be really sure that we do not face such time out problems
> > again, let's also increase the time out value from 100s to 120s
> > instead.
> >
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > ---
> >  tests/prom-env-test.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> Seems to cut the elapsed realtime for the pseries board
> down from about 90s to 55s. Hopefully that plus the
> boosted timeout will help.
> 
> Tested-by: Peter Maydell <peter.maydell@linaro.org>

Peter, will you merge this directly, or do you want me to take it
through my tree?
Peter Maydell Feb. 10, 2017, 12:48 p.m. UTC | #3
On 9 February 2017 at 23:15, David Gibson <david@gibson.dropbear.id.au> wrote:
> On Thu, Feb 09, 2017 at 02:37:26PM +0000, Peter Maydell wrote:
>> On 9 February 2017 at 14:13, Thomas Huth <thuth@redhat.com> wrote:
>> > Peter Maydell recently ran into time-out problems with the
>> > prom-env test on a rather slow ARM board. To tackle this issue,
>> > we can speed up the test by running QEMU with "-nodefaults" here,
>> > so that SLOF has less devices to scan during boot, and by using
>> > the "nvramrc" environment variable instead of "boot-command",
>> > since this variable is evaluated earlier in the boot process.
>> > And to be really sure that we do not face such time out problems
>> > again, let's also increase the time out value from 100s to 120s
>> > instead.
>> >
>> > Signed-off-by: Thomas Huth <thuth@redhat.com>
>> > ---
>> >  tests/prom-env-test.c | 8 +++++---
>> >  1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> Seems to cut the elapsed realtime for the pseries board
>> down from about 90s to 55s. Hopefully that plus the
>> boosted timeout will help.
>>
>> Tested-by: Peter Maydell <peter.maydell@linaro.org>
>
> Peter, will you merge this directly, or do you want me to take it
> through my tree?

I just did a full test with the intention of merging it into
master, and I noticed it causes new warnings on the sparc
prom tests:

TEST: tests/prom-env-test... (pid=17171)
  /sparc/prom-env/SPARCbook:
Warning: nic
 lance.0 has no peer
OK
  /sparc/prom-env/Voyager:
Warning: nic
 lance.0 has no peer
OK
  /sparc/prom-env/SS-20:
Warning: nic
 lance.0 has no peer
OK
PASS: tests/prom-env-test

So it needs some tweaking, I think.

thanks
-- PMM
Thomas Huth Feb. 10, 2017, 12:51 p.m. UTC | #4
On 10.02.2017 13:48, Peter Maydell wrote:
> On 9 February 2017 at 23:15, David Gibson <david@gibson.dropbear.id.au> wrote:
>> On Thu, Feb 09, 2017 at 02:37:26PM +0000, Peter Maydell wrote:
>>> On 9 February 2017 at 14:13, Thomas Huth <thuth@redhat.com> wrote:
>>>> Peter Maydell recently ran into time-out problems with the
>>>> prom-env test on a rather slow ARM board. To tackle this issue,
>>>> we can speed up the test by running QEMU with "-nodefaults" here,
>>>> so that SLOF has less devices to scan during boot, and by using
>>>> the "nvramrc" environment variable instead of "boot-command",
>>>> since this variable is evaluated earlier in the boot process.
>>>> And to be really sure that we do not face such time out problems
>>>> again, let's also increase the time out value from 100s to 120s
>>>> instead.
>>>>
>>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>>> ---
>>>>  tests/prom-env-test.c | 8 +++++---
>>>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>>
>>> Seems to cut the elapsed realtime for the pseries board
>>> down from about 90s to 55s. Hopefully that plus the
>>> boosted timeout will help.
>>>
>>> Tested-by: Peter Maydell <peter.maydell@linaro.org>
>>
>> Peter, will you merge this directly, or do you want me to take it
>> through my tree?
> 
> I just did a full test with the intention of merging it into
> master, and I noticed it causes new warnings on the sparc
> prom tests:
> 
> TEST: tests/prom-env-test... (pid=17171)
>   /sparc/prom-env/SPARCbook:
> Warning: nic
>  lance.0 has no peer
> OK
>   /sparc/prom-env/Voyager:
> Warning: nic
>  lance.0 has no peer
> OK
>   /sparc/prom-env/SS-20:
> Warning: nic
>  lance.0 has no peer
> OK
> PASS: tests/prom-env-test
> 
> So it needs some tweaking, I think.

D'oh, sorry, I should have checked that ... it's likely of the new
"-nodefaults" flag ... I'll have a look.

 Thomas
diff mbox

Patch

diff --git a/tests/prom-env-test.c b/tests/prom-env-test.c
index 0ba6f48..7d97ae4 100644
--- a/tests/prom-env-test.c
+++ b/tests/prom-env-test.c
@@ -30,8 +30,8 @@  static void check_guest_memory(void)
     uint32_t signature;
     int i;
 
-    /* Poll until code has run and modified memory. Wait at most 30 seconds */
-    for (i = 0; i < 10000; ++i) {
+    /* Poll until code has run and modified memory. Wait at most 120 seconds */
+    for (i = 0; i < 12000; ++i) {
         signature = readl(ADDRESS);
         if (signature == MAGIC) {
             break;
@@ -46,7 +46,9 @@  static void test_machine(const void *machine)
 {
     char *args;
 
-    args = g_strdup_printf("-M %s,accel=tcg -prom-env 'boot-command=%x %x l!'",
+    args = g_strdup_printf("-M %s,accel=tcg -nodefaults "
+                           "-prom-env 'use-nvramrc?=true' "
+                           "-prom-env 'nvramrc=%x %x l!'",
                            (const char *)machine, MAGIC, ADDRESS);
 
     qtest_start(args);