13
13
# under the License.
14
14
import datetime
15
15
import functools
16
+ import subprocess
16
17
from unittest import mock
17
18
18
19
import fixtures as og_fixtures
26
27
from oslo_utils import uuidutils
27
28
from ovsdbapp .backend .ovs_idl import event
28
29
from ovsdbapp .backend .ovs_idl import idlutils
30
+ import tenacity
29
31
30
32
from neutron .common .ovn import constants as ovn_const
31
33
from neutron .common import utils as n_utils
@@ -144,6 +146,10 @@ def _create_fip(self, port, fip_address):
144
146
'port_id' : port ['id' ]}})
145
147
return r1_f2
146
148
149
+ @tenacity .retry (
150
+ retry = tenacity .retry_if_exception_type (subprocess .TimeoutExpired ),
151
+ wait = tenacity .wait_exponential (multiplier = 0.02 , max = 1 ),
152
+ reraise = True )
147
153
def _check_mac_binding_exists (self , macb_id ):
148
154
cmd = ['ovsdb-client' , 'transact' ,
149
155
self .mech_driver .sb_ovn .connection_string ]
@@ -156,8 +162,7 @@ def _check_mac_binding_exists(self, macb_id):
156
162
cmd += ['["OVN_Southbound", {"op": "select", "table": "MAC_Binding", '
157
163
'"where": [["_uuid", "==", ["uuid", "%s"]]]}]' % macb_id ]
158
164
159
- out , _ = processutils .execute (* cmd ,
160
- log_errors = False )
165
+ out , _ = processutils .execute (* cmd , log_errors = False , timeout = 3 )
161
166
return str (macb_id ) in out
162
167
163
168
def test_floatingip_mac_bindings (self ):
0 commit comments