From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 33CFE6DE0F3B for ; Tue, 21 May 2019 13:17:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.229 X-Spam-Level: X-Spam-Status: No, score=0.229 tagged_above=-999 required=5 tests=[AWL=-0.020, HEADER_FROM_DIFFERENT_DOMAINS=0.249] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gf9TMbh9GDLd for ; Tue, 21 May 2019 13:17:06 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id AE4386DE0F39 for ; Tue, 21 May 2019 13:17:06 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 505591001EC; Tue, 21 May 2019 23:17:03 +0300 (EEST) From: Tomi Ollila To: notmuch@notmuchmail.org Cc: tomi.ollila@iki.fi Subject: [PATCH] test: redirect STDIN from /dev/tty Date: Tue, 21 May 2019 23:17:02 +0300 Message-Id: <20190521201702.28754-1-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.13.3 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 20:17:09 -0000 Without this stdin may be anything that parent process provided for it. Test processes might have tried to read something from it, which would have caused undeterministic behavior. E.g. gdb(1) tries to do tty related ioctls on fd 0 (and fd 1 and fd 2, but those are redirected to 'test.output' before test runs). --- Hopefully this fixes the parallel problems -- In case of moreutils parallel only stdout and stderr are captured and all other fd's left untouched (provided I read web namual correctly). With GNU parallel docs did not help -- but as we pipe $TESTS to parallel in that case things might be even more complicated there (i don't undersand why but anyway) test/test-lib.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test-lib.sh b/test/test-lib.sh index ed7f6aa7..068e1029 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -55,6 +55,9 @@ done,*) ;; esac +# STDIN from /dev/null. EOF for readers (and ENOTTY for tty related ioctls). +exec &1 7>&2 # Make xtrace debugging (when used) use redirected STDERR, with verbose lead: -- 2.21.0