From: Stéphane Graber Date: Mon, 9 Jun 2014 21:13:56 +0000 (-0400) Subject: tests: Wait 5s for init to respond in lxc-test-autostart X-Git-Tag: lxc-1.1.0.alpha1~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7aa56b85ca96f321ef6aadb60a28f8c16bec44d;p=thirdparty%2Flxc.git tests: Wait 5s for init to respond in lxc-test-autostart lxc-test-autostart occasionaly fails at the restart test in the CI environment. Looking at the current test case, the most obvious race there is if lxc-wait exists succesfuly immediately after LXC marked the container RUNNING (init spawned) but before init had a chance to setup the signal handlers. To avoid this potential race period, let's add a 5s delay between the tests to give a chance for init to finish starting up. Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- diff --git a/src/tests/lxc-test-autostart b/src/tests/lxc-test-autostart index 6c2f5aefb..845a06a94 100755 --- a/src/tests/lxc-test-autostart +++ b/src/tests/lxc-test-autostart @@ -67,10 +67,12 @@ fi # Start it lxc-autostart -g lxc-auto-test lxc-wait -n $CONTAINER_NAME -t 5 -s RUNNING || (echo "Container didn't start" && exit 1) +sleep 5 # Restart it lxc-autostart -g lxc-auto-test -r lxc-wait -n $CONTAINER_NAME -t 5 -s RUNNING || (echo "Container didn't restart" && exit 1) +sleep 5 # Shut it down lxc-autostart -g lxc-auto-test -s -t 120