[ovs-dev] [PATCH repost 3/3] tests: Make parse_listening_port entirely reliable.

Flavio Leitner fbl at sysclose.org
Thu Nov 26 17:58:54 UTC 2015


On Tue, Sep 29, 2015 at 11:17:15AM -0700, Ben Pfaff wrote:
> In test runs, I've occasionally seen mysterious failures in which
> parse_listening_port failed to find the listening port even though an
> examination of the log file showed that it was there.  I spent some time
> trying to figure out what was going wrong.  It seemed like everything was
> lined up properly to ensure that a command like "ovs-vsctl set-controller
> br0 tcp:127.0.0.1:0" would only return to the command prompt after the
> new listener was ready and the proper log message was written.  It was
> obviously a very small race because I could only reproduce it with a large
> test parallelism (e.g. -j10 on my quad-core laptop).
> 
> The problem turned out to be asynchronous logging in ovs-vswitchd.  If I
> turned that off, by commenting out the call to vlog_enable_async() in
> bridge.c, parse_listening_port became reliable.
> 
> This commit works around the problem by making parse_listening_port retry
> for a while if necessary.  It also transforms the shell function into an
> m4 macro (so that it can use OVS_WAIT_UNTIL) and renames it to
> all-uppercase to follow the convention for macros.
> 
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---

What I don't like about this patch is that a failure now takes 10
secs for the test complete, but hey, it's not supposed to fail :-)

I broke the regex and the failures are reported correctly.

Acked-by: Flavio Leitner <fbl at sysclose.org>





More information about the dev mailing list