test: Add timeout before checking for status

Under some slow environment (nested VMs) or with some
not as fast runtimes (Clear Containers), asking for a
status right away is racy.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz 2017-09-14 19:34:01 +02:00
parent 0eaa52c356
commit a2e08d5dc4

View file

@ -28,6 +28,7 @@ function teardown() {
run crictl start "$ctr_id"
echo "$output"
[ "$status" -eq 0 ]
run sleep 5
run crictl inspect --output yaml "$ctr_id"
echo "$output"
[ "$status" -eq 0 ]
@ -53,6 +54,7 @@ function teardown() {
run crictl start "$ctr_id"
echo "$output"
[ "$status" -eq 0 ]
run sleep 5
run crictl inspect --output yaml "$ctr_id"
echo "$output"
[ "$status" -eq 0 ]