[lxc-devel] [PATCH] tests: Wait 5s for init to respond in lxc-test-autostart

Serge Hallyn serge.hallyn at ubuntu.com
Tue Jun 10 05:49:45 UTC 2014


Quoting Stéphane Graber (stgraber at ubuntu.com):
> 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 <stgraber at ubuntu.com>

They are ubuntu containers, so you *could* bind a fifo into the container
and add an upstart job to write to the fifo on runlevel 2 :)

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  src/tests/lxc-test-autostart | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/tests/lxc-test-autostart b/src/tests/lxc-test-autostart
> index 6c2f5ae..845a06a 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
> -- 
> 1.9.1
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list