From: Ben Pfaff Date: Mon, 23 Apr 2012 17:05:50 +0000 (-0700) Subject: tests: Avoid daemon race between pidfile creation and parent notification. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34a5710475c6772e94d7fc5168d8615ac9183afc;p=openvswitch tests: Avoid daemon race between pidfile creation and parent notification. This was causing "check-valgrind" to sometimes fail in this test. Signed-off-by: Ben Pfaff --- diff --git a/tests/daemon.at b/tests/daemon.at index 69fff258..f188e7cb 100644 --- a/tests/daemon.at +++ b/tests/daemon.at @@ -39,6 +39,11 @@ AT_CHECK( parent=`cat parent` && test $parentpid = $parent], [0], [], [], [kill `cat parent`]) +# Avoid a race between pidfile creation and notifying the parent, +# which can easily trigger if ovsdb-server is slow (e.g. due to valgrind). +OVS_WAIT_UNTIL( + [ovs-appctl --timeout=10 -t "`pwd`/unixctl" version], + [kill `cat pid`]) # Kill the daemon process, making it look like a segfault, # and wait for a new child process to get spawned. AT_CHECK([cp pid oldpid], [0], [], [], [kill `cat parent`])