Commit ee9b6f51 by Stéphane Graber

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: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent b7ee866b
...@@ -67,10 +67,12 @@ fi ...@@ -67,10 +67,12 @@ fi
# Start it # Start it
lxc-autostart -g lxc-auto-test lxc-autostart -g lxc-auto-test
lxc-wait -n $CONTAINER_NAME -t 5 -s RUNNING || (echo "Container didn't start" && exit 1) lxc-wait -n $CONTAINER_NAME -t 5 -s RUNNING || (echo "Container didn't start" && exit 1)
sleep 5
# Restart it # Restart it
lxc-autostart -g lxc-auto-test -r lxc-autostart -g lxc-auto-test -r
lxc-wait -n $CONTAINER_NAME -t 5 -s RUNNING || (echo "Container didn't restart" && exit 1) lxc-wait -n $CONTAINER_NAME -t 5 -s RUNNING || (echo "Container didn't restart" && exit 1)
sleep 5
# Shut it down # Shut it down
lxc-autostart -g lxc-auto-test -s -t 120 lxc-autostart -g lxc-auto-test -s -t 120
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment