From a83df931b969d1d8db823c3cfa05b4be059cb5a5 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Tue, 17 Dec 2019 19:28:25 +0530 Subject: [PATCH] Replace pipe with redirection to a subshell (#13409) When the writing process sends an EAGAIN to the fd, tee dies. We correct this behavior by redirecting the output to a subshell which handles this correctly. Relevant link here: https://serverfault.com/questions/369757/why-is-this-tee-losing-stdout --- scripts/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test.sh b/scripts/test.sh index 81d5124372..9c36b069a2 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -15,7 +15,7 @@ echo "Packages to test: $PACKAGES" find . -name 'cprofile*.out' -exec sh -c 'rm "{}"' \; find . -type d -name data -not -path './vendor/*' | xargs rm -rf -$GO test $GOFLAGS -run=$TESTS $TESTFLAGS -v -timeout=2000s -covermode=count -coverpkg=$PACKAGES_COMMA -exec $DIR/test-xprog.sh $PACKAGES 2>&1 | tee output +$GO test $GOFLAGS -run=$TESTS $TESTFLAGS -v -timeout=2000s -covermode=count -coverpkg=$PACKAGES_COMMA -exec $DIR/test-xprog.sh $PACKAGES 2>&1 > >( tee output ) EXIT_STATUS=$? cat output | $GOPATH/bin/go-junit-report > report.xml