[ovs-dev] [PATCH 1/2] tests: Avoid daemon race between pidfile creation and parent notification.

Ben Pfaff blp at nicira.com
Mon Apr 23 21:12:10 UTC 2012


Thanks, I pushed both of these to master.

On Mon, Apr 23, 2012 at 11:08:11AM -0700, Ethan Jackson wrote:
> Looks good, thanks.
> 
> Ethan
> 
> On Mon, Apr 23, 2012 at 10:08, Ben Pfaff <blp at nicira.com> wrote:
> > This was causing "check-valgrind" to sometimes fail in this test.
> >
> > Signed-off-by: Ben Pfaff <blp at nicira.com>
> > ---
> >  tests/daemon.at |    5 +++++
> >  1 files changed, 5 insertions(+), 0 deletions(-)
> >
> > diff --git a/tests/daemon.at b/tests/daemon.at
> > index 69fff25..f188e7c 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`])
> > --
> > 1.7.2.5
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list