From: Ben Pfaff Date: Sun, 5 Jul 2015 17:20:35 +0000 (-0700) Subject: tests: Make OVS_WAIT_WHILE, OVS_WAIT_UNTIL run even faster in some cases. X-Git-Tag: v2.5.0~251 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=4c619f4d8bb2d773e34cc9a608b125b2601c1271;p=cascardo%2Fovs.git tests: Make OVS_WAIT_WHILE, OVS_WAIT_UNTIL run even faster in some cases. Sometimes OVS_WAIT_WHILE and OVS_WAIT_UNTIL are used for conditions that tend to be true immediately but sometimes take a moment or two. This change makes such cases 0.1 seconds faster (which could add up over hundreds of tests). Signed-off-by: Ben Pfaff Reviewed-by: Simon Horman Acked-by: Flavio Leitner --- diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at index 90fb83594..bfd06818b 100644 --- a/tests/ovs-macros.at +++ b/tests/ovs-macros.at @@ -38,7 +38,10 @@ ovs_setenv() { } ovs_wait () { - # First try a quick sleep, so that the test completes very quickly + # First try the condition without waiting. + ovs_wait_cond && return 0 + + # Try a quick sleep, so that the test completes very quickly # in the normal case. POSIX doesn't require fractional times to # work, so this might not work. sleep 0.1