Skip to content

Commit

Permalink
ovn-northd.at: Fix race condition in pause and resume test.
Browse files Browse the repository at this point in the history
A recent build failed because the pause and resume test failed. After
resuming northd and northd-backup, the status of northd was "standby"
instead of the expected "active". This happened for one of two reasons:

1) For some reason, northd failed to retrieve the lock between resuming
   and checking its status, so it reported as being "standby".
2) northd-backup won the race to get the lock, so it became the active
   instance instead of northd.

This change alters the test to fix both of these issues. Instead of
resuming both northd and northd-backup, we start by only resuming
northd. We then wait until it reports that it is active before we resume
northd-backup. This way, they are guaranteed to be in the states we
expect.

Signed-off-by: Mark Michelson <mmichels@redhat.com>
Acked-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
putnopvut committed May 12, 2020
1 parent 129d5c5 commit 85c16f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/ovn-northd.at
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,12 @@ OVS_WAIT_UNTIL([

# Now resume ovn-northd
as northd ovs-appctl -t ovn-northd resume
as northd-backup ovs-appctl -t ovn-northd resume
AT_CHECK([test xfalse = x`as northd ovn-appctl -t ovn-northd is-paused`])
AT_CHECK([as northd ovn-appctl -t ovn-northd status], [0], [Status: active
OVS_WAIT_UNTIL([as northd ovn-appctl -t ovn-northd status], [0],
[Status: active
])

as northd-backup ovs-appctl -t ovn-northd resume
AT_CHECK([test xfalse = x`as northd-backup ovn-appctl -t ovn-northd \
is-paused`])
AT_CHECK([as northd-backup ovn-appctl -t ovn-northd status], [0],
Expand Down

0 comments on commit 85c16f4

Please sign in to comment.