From 9907a8df4d784afa1ef5afd6da82c313898879f6 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 21 Dec 2017 15:47:09 -0800 Subject: [PATCH] Fix test hang when running under ninja The psub tests create a fifo and launch a background job to write to it. However fifos have this obnoxious behavior where opening the file blocks until both sides are ready. In one of the tests we don't actually read from the fifo we create, so the background job hangs, and the tests never complete. Fix this by just reading from the fifo. --- tests/psub.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/psub.in b/tests/psub.in index 5a4808477..76d8787dc 100644 --- a/tests/psub.in +++ b/tests/psub.in @@ -12,6 +12,10 @@ rm $filename set -l filename (echo foo | psub --testing --fifo) test -p $filename or echo 'psub is not a fifo' >&2 +# hack: the background write that psub peforms may block +# until someone opens the fifo for reading. So make sure we +# actually read it. +cat $filename > /dev/null rm $filename cat (echo foo | psub)