bfd.at: Fix intermittent failure of test - flap_count.
authorAlex Wang <alexw@nicira.com>
Thu, 2 Oct 2014 04:59:16 +0000 (21:59 -0700)
committerAlex Wang <alexw@nicira.com>
Fri, 3 Oct 2014 06:12:49 +0000 (23:12 -0700)
ovs-vsctl commands like 'ovs-vsctl list Interface p1' use the
'monitor' RPC method, which causes ovsdb sending updates to
the command session when changes are committed to the monitored
table.  Since ovs-vsctl commands are short-lived, there is chance
that ovs-vsctl terminates the connection to ovsdb right before
ovsdb sends the update.  This race will cause the following
warning entries in ovsdb-server log:

  |jsonrpc|WARN|unix: receive error: Connection reset by peer
  |reconnect|WARN|unix: connection dropped (Connection reset by peer)
  |jsonrpc|WARN|unix: send error: Broken pipe
  |reconnect|WARN|unix: connection dropped (Broken pipe)

The bfd:flap_count test is particularly prone to this race,
since the test aligns the statistics updates (every 5 seconds)
with the invocation of ovs-vsctl commands.

In the short term, this commit fixes the intermittent failure
by disabling the ovs-vswitchd statistics updates using a huge
update interval.

In the long run, we will research on making ovsdb not send
further updates to sessions like ovs-vsctl.

Signed-off-by: Alex Wang <alexw@nicira.com>
tests/bfd.at

index 609c0ad..8bf88f2 100644 (file)
@@ -684,6 +684,9 @@ OVS_VSWITCHD_START([add-br br1 -- \
                     set Interface p1 bfd:enable=true bfd:min_tx=100 bfd:min_rx=100])
 
 ovs-appctl time/stop
+# Disable the stats update to prevent the race between ovsdb updating
+# stats and ovs-vsctl cmd closing the jsonrpc session.
+AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:stats-update-interval=50000000])
 
 # Part-1 wait for a while to stablize bfd.
 ovs-appctl time/warp 10100 100