Browse code

Fix hanging on tests failing

Tee hanging when `go test` exit with non-zero code.
Fixes #5672
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)

Alexandr Morozov authored on 2014/05/18 20:17:31
Showing 3 changed files
... ...
@@ -10,6 +10,6 @@ bundle_test_integration() {
10 10
 
11 11
 # this "grep" hides some really irritating warnings that "go test -coverpkg"
12 12
 # spews when it is given packages that aren't used
13
+exec > >(tee -a $DEST/test.log) 2>&1
13 14
 bundle_test_integration 2>&1 \
14
-	| grep --line-buffered -v '^warning: no packages being tested depend on ' \
15
-	| tee $DEST/test.log
15
+	| grep --line-buffered -v '^warning: no packages being tested depend on '
... ...
@@ -11,6 +11,7 @@ bundle_test_integration_cli() {
11 11
 }
12 12
 
13 13
 # subshell so that we can export PATH without breaking other things
14
+exec > >(tee -a $DEST/test.log) 2>&1
14 15
 (
15 16
 	export PATH="$DEST/../binary:$DEST/../dynbinary:$PATH"
16 17
 
... ...
@@ -40,4 +41,4 @@ bundle_test_integration_cli() {
40 40
 	DOCKERD_PID=$(set -x; cat $DEST/docker.pid)
41 41
 	( set -x; kill $DOCKERD_PID )
42 42
 	wait $DOCKERD_PID || true
43
-) 2>&1 | tee $DEST/test.log
43
+)
... ...
@@ -49,7 +49,8 @@ bundle_test_unit() {
49 49
 			echo
50 50
 			true
51 51
 		fi
52
-	} 2>&1 | tee $DEST/test.log
52
+	}
53 53
 }
54 54
 
55
+exec > >(tee -a $DEST/test.log) 2>&1
55 56
 bundle_test_unit