Re: t0008 hang on streaming test (OS X)
- From
Jeff King <peff@peff.net>
- Date
- Jul 11, 2013, 13:34 UTC
- Message-ID
- <20130711133414.GF6015@sigill.intra.peff.net>
- In-Reply-To
- <6050FACA-CAD4-4E41-B7DC-D7A2036AA233@gernhardtsoftware.com>
On Wed, Jul 10, 2013 at 12:36:40PM -0400, Brian Gernhardt wrote:
Show 7 quoted lines
> The newest test in t0008 "streaming support for --stdin", seems to > hang sporadically on my MacBook Pro (running 10.8.4). The hang seems > to be related to running it in parallel with other tests, as I can > only reliably cause it by running with prove and -j 3. However, once > that has hung I am able to semi-reliably have it occur by running the > test separately (with the test hung in the background, using separate > trash directories via the --root option).
I can't replicate the hang here (on Linux) doing:
for i in `seq 1 30`; do
./t0008-ignores.sh --root=/tmp/foo/$i &
doneDo you know which test it is hanging on? You mentioned that you can replicate it outside of "prove"; what does running with "-v" say?
The last test in t0008, with the fifos, would make me the most suspicious. The way we do it _should_ be fine, but I'm wondering if the shell is blocking in exec here:
mkfifo in out && (git check-ignore -n -v --stdin <in >out &) && exec 9>in &&
That is, if the fifo is not opened for some reason by the backgrounded process (there's a race, of course, but the outer shell should just block until the sub-shell actually opens it). I wonder if the descriptor-opening behavior of:
cmd <in >out &
is different between shells (that is, if it backgrounds the opening of in and out on some shells, but not on others). But then I would expect it to fail consistently.
Just for fun, does switching the middle line there to:
(sh -c "git check-ignore -n -v --stdin <in >out" &) &&
have any effect?
-Peff