On Fri, Dec 07, 2012 at 01:57:14PM +0200, Jarno Rajahalme wrote:
> On Dec 4, 2012, at 21:06 , ext Ben Pfaff wrote:
> 
> > On Tue, Dec 04, 2012 at 05:10:29PM +0200, Jarno Rajahalme wrote:
> >> It seems to me that depending on test machine load or other
> >> scheduling reasons, it is possible that some tests fail sometimes,
> >> even if there is no real failure. One such case below, where it
> >> seems that the middle reply comes in a bit later than
> >> anticipated. On repeat this failure did not occur again.
> > 
> > From time to time we this kind of problem does get introduced into the
> > testsuite.  Sorry about that.  Fixes are welcome; I often fix them if
> > I start seeing them in my own testsuite runs.
> > 
> 
> OK. Would a proper fix be to suppress the "sent" line(s) and just
> check that the responses match?

At first glance what I've appended is a proper fix.  Will you review it?

> Haven't seen the failure I reported since, though.

Sometimes you can reproduce failures just by running a particular test
in a loop.  You can make the test run faster with a technique like this:

    amfilt make -j4 check TESTSUITEFLAGS='-d 541'
    while tests/testsuite.dir/0541/run -d; do : ; done

--8<--------------------------cut here-------------------------->8--

From: Ben Pfaff <b...@nicira.com>
Date: Fri, 7 Dec 2012 07:38:11 -0800
Subject: [PATCH] tests: Avoid race condition in flow monitoring test.

The execution of "ovs-appctl -t ovs-ofctl ofctl/send" could happen before
ovs-appctl received and printed the
    NXST_FLOW_MONITOR reply (xid=0x0):
     event=ADDED table=0 cookie=0 in_port=2 actions=output:1
msesage, which could cause the
    send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
message to be printed before rather than after the NXST_FLOW_MONITOR reply.

This commit fixes the problem by inserting a serializing barrier.

Reported-by: Jarno Rajahalme <jarno.rajaha...@nsn.com>
Signed-off-by: Ben Pfaff <b...@nicira.com>
---
 tests/ofproto.at |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/ofproto.at b/tests/ofproto.at
index 107e366..9c0c6df 100644
--- a/tests/ofproto.at
+++ b/tests/ofproto.at
@@ -1463,6 +1463,7 @@ OFPT_BARRIER_REPLY:
 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
 ovs-ofctl add-flow br0 in_port=1,actions=output:2
 ovs-ofctl add-flow br0 in_port=2,actions=output:1
+ovs-appctl -t ovs-ofctl ofctl/barrier
 ovs-appctl -t ovs-ofctl ofctl/send 
010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
 ovs-appctl -t ovs-ofctl ofctl/barrier
 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
@@ -1472,6 +1473,7 @@ AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' 
monitor.log], [0],
  event=ADDED table=0 cookie=0 in_port=1 actions=output:2
 NXST_FLOW_MONITOR reply (xid=0x0):
  event=ADDED table=0 cookie=0 in_port=2 actions=output:1
+OFPT_BARRIER_REPLY:
 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
 NXST_FLOW_MONITOR reply (xid=0x0):
  event=ABBREV xid=0x12345678
-- 
1.7.10.4
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to