Browse code

Prevent CI from getting stuck if shims are left alive

This will kill any left over containerd-shims to avoid the integration
script to stay stuck while it waits on them.

It will then causes CI to fail (even if all the tests succeeded).

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

Kenfe-Mickael Laventure authored on 2016/06/17 02:41:21
Showing 1 changed files
... ...
@@ -15,4 +15,17 @@ bundle_test_integration_cli() {
15 15
 	bundle_test_integration_cli
16 16
 
17 17
 	bundle .integration-daemon-stop
18
+
19
+	if [ "$(go env GOOS)" != 'windows' ]
20
+	then
21
+		leftovers=$(ps -ax -o pid,cmd | awk '$2 == "docker-containerd-shim" && $4 ~ /.*\/bundles\/.*\/test-integration-cli/ { print $1 }')
22
+		if [ -n "$leftovers" ]
23
+		then
24
+			ps aux
25
+			kill -9 $leftovers 2> /dev/null
26
+			echo "!!!! WARNING you have left over shim(s), Cleanup your test !!!!"
27
+			exit 1
28
+		fi
29
+	fi
30
+
18 31
 ) 2>&1 | tee -a "$DEST/test.log"