[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Avoid passing autotest job fds to test groups.

From: Eric Blake
Subject: Re: [PATCH] Avoid passing autotest job fds to test groups.
Date: Wed, 21 Jul 2010 06:51:34 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.0.5

On 07/20/2010 10:21 PM, Ralf Wildenhues wrote:
> * lib/autotest/general.m4 (AT_INIT) <Fifo job dispatcher>: Remove
> commented closing of job output fd.  In serial test group driver,
> ensure $at_jobs is set to 1, so other parts of Autotest can
> reliably use this variable as indicator for parallel testing.

The $at_jobs change seems independently useful, even if we aren't
relying on it right now.  I also see how I can compress the testsuite a
bit by adding another shell function; patch coming up shortly...

> * Eric Blake wrote on Wed, Jul 21, 2010 at 05:49:59AM CEST:
>> Technically, the AT_CHECK commands only need worry about one fd;
>> AT_JOB_FIFO_OUT_FD (in fact, my patch already clobbers AT_JOB_FIFO_IN_FD
>> before the test is run),
> For all but the first child.

But the first child is run in a context where AT_JOB_FIFO_IN_FD was not
yet opened by the parent, and thus is not a problem (technically, I
suppose that means you could have inherited a random fd 6 from whoever
invoked the overall testsuite, but at least with that, you can't exploit
'echo >&6' to change the state of the parallel tests).

> @@ -1913,6 +1914,12 @@ AT_xfail
>  echo "#                             -*- compilation -*-" >> "$at_group_log"
>  (
>    AS_ECHO(["AT_ordinal. m4_defn([AT_line]): testing $at_desc ..."])
> +  if test $at_jobs -ne 1; then
> +    if $at_first; then
> +      exec AT_JOB_FIFO_IN_FD>&-
> +    fi

So this part is not necessary.  But maybe we want to do a global:

for i in 3 4 5 6 7; do
  eval exec $i>&-

up front, to close any random fds inherited from outside the testsuite,
so that all tests are run with the same set of fds, rather than the
first test inheriting more random fds than any other test?

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]