From 673d0af97d12f64a841c5a6ec24dca53e46784f6 Mon Sep 17 00:00:00 2001 From: Marc CARRE Date: Mon, 13 Mar 2017 13:16:18 +0000 Subject: [PATCH] Add failing test catching defunct launch.sh processses. Reproduces issue #2836, i.e.: - during initialisation: ``` $ ps auxf [...] root 1380 0.4 1.6 879660 60732 ? Ssl Mar13 5:54 /usr/bin/docker daemon -H fd:// -H unix:/// root 1664 0.0 0.4 502116 18540 ? Ssl Mar13 0:06 \_ docker-containerd -l /var/run/docker/li root 12615 0.0 0.1 200496 5424 ? Sl 14:38 0:00 \_ docker-containerd-shim c5637e5bbdcb root 12629 6.2 1.6 296400 62312 ? Ssl 14:38 0:00 | \_ /home/weave/weaver --port=6783 root 12910 0.0 0.0 1524 68 ? S 14:38 0:00 | \_ /bin/sh /home/weave/launch. root 13002 0.0 0.0 1772 1232 ? S 14:38 0:00 | \_ /bin/sh /home/weave/wea root 13027 0.0 0.0 1772 320 ? S 14:38 0:00 | \_ /bin/sh /home/weave root 13028 0.0 0.0 14656 2708 ? S 14:38 0:00 | \_ curl -o /tmp/we [...] ``` - after initialisation: ``` $ ps auxf [...] root 1380 0.4 1.6 879660 60732 ? Ssl Mar13 5:54 /usr/bin/docker daemon -H fd:// -H unix:/// root 1664 0.0 0.4 502116 18540 ? Ssl Mar13 0:06 \_ docker-containerd -l /var/run/docker/li root 12615 0.0 0.1 200496 5424 ? Sl 14:38 0:00 \_ docker-containerd-shim c5637e5bbdcb root 12629 3.5 1.6 297460 63340 ? Ssl 14:38 0:00 | \_ /home/weave/weaver --port=6783 root 12910 0.0 0.0 0 0 ? Z 14:38 0:00 | \_ [launch.sh] [...] ``` Sample output: ``` test #5 "run_on mct-0.us-central1-a.weave-net ps aux | grep -c '[d]efunct'" failed: expected "0" got "1" test #6 "run_on mct-1.us-central1-a.weave-net ps aux | grep -c '[d]efunct'" failed: expected "0" got "1" test #7 "run_on mct-2.us-central1-a.weave-net ps aux | grep -c '[d]efunct'" failed: expected "0" got "1" 3 of 8 tests failed in 62.012s. ``` --- test/840_weave_kube_3_test.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/840_weave_kube_3_test.sh b/test/840_weave_kube_3_test.sh index 7823f929..6a9e8db6 100755 --- a/test/840_weave_kube_3_test.sh +++ b/test/840_weave_kube_3_test.sh @@ -52,6 +52,11 @@ assert_raises "run_on $HOST1 $PING $HOST2EXPIP" assert_raises "run_on $HOST2 $PING $HOST1EXPIP" assert_raises "run_on $HOST3 $PING $HOST2EXPIP" +# Ensure we do not generate any defunct process (e.g. launch.sh) after starting weaver: +assert "run_on $HOST1 ps aux | grep -c '[d]efunct'" "0" +assert "run_on $HOST2 ps aux | grep -c '[d]efunct'" "0" +assert "run_on $HOST3 ps aux | grep -c '[d]efunct'" "0" + # See if we can get some pods running that connect to the network run_on $HOST1 "kubectl run hello --image=weaveworks/hello-world --replicas=3"