respawn_interval=respawn_interval,
)
self.data_received = False
- if respawn_interval:
- self._default_timeout = respawn_interval / 2
- else:
- self._default_timeout = 10
@property
def is_active(self):
"""
return bool(list(self.iter_stdout())) or not self.is_active
- def start(self, block=False, timeout=None):
- timeout = timeout or self._default_timeout
+ def start(self, block=False, timeout=5):
super(SimpleInterfaceMonitor, self).start()
if block:
- eventlet.timeout.Timeout(timeout)
- while not self.is_active:
- eventlet.sleep()
+ with eventlet.timeout.Timeout(timeout):
+ while not self.is_active:
+ eventlet.sleep()
def _kill(self, *args, **kwargs):
self.data_received = False
self.monitor = ovsdb_monitor.SimpleInterfaceMonitor(
root_helper=self.root_helper)
self.addCleanup(self.monitor.stop)
- self.monitor.start(block=True)
+ self.monitor.start(block=True, timeout=60)
def test_has_updates(self):
self.assertTrue(self.monitor.has_updates,