Hi Eric, * Eric Blake wrote on Wed, Jul 21, 2010 at 02:51:34PM CEST: > 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...
Thanks. > > * 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). ACK. Lack of coffee and all that. ;-) > > + 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>&- > done (why not just exec 5>&- 6>&- 7>&-?) > 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? We don't do anything with fds 3 and 4; either we consider them special, then shouldn't close them for that historical reason, or we could just use them for internal purposes. Or decide now not use them because we've never done so (and our users may have come to rely on that fact). But anyway this still means that users wanting to pass extra fds to test groups, should know that 5, 6, and 7 are reserved by Autotest, at least for passing from outside the testsuite. And probably that 5 is better avoided inside as well (I'm not sure if that's necessary, but it might be at some point). Cheers, Ralf
