From 07fb325b44b7420279cdcc8b18135ba3de2de45b Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Mon, 7 Dec 2020 12:48:06 +0100 Subject: [PATCH] Add some wait time between stopping and starting again ovsdb monitor In functional tests of the ovsdb_monitor, sometimes during high load of the host where tests are run, "error" message from the killed process can be received by neutron's async_process after new process was already spawned. And that causes failure of the test as new ovsdb_monitor will not receive events which are expected. To workaround that issue this patch adds sleep for few seconds between stopping old and starting new ovsdb_monitor process. Closes-Bug: #1907068 Change-Id: Ib37a52a623943ae4b6a4ec829c5d12a74514e86c (cherry picked from commit 0aa7f5b5117945499a8511987668d6c59fc680e5) --- neutron/tests/functional/agent/linux/test_ovsdb_monitor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neutron/tests/functional/agent/linux/test_ovsdb_monitor.py b/neutron/tests/functional/agent/linux/test_ovsdb_monitor.py index e644e68f2d2..210dbc4a749 100644 --- a/neutron/tests/functional/agent/linux/test_ovsdb_monitor.py +++ b/neutron/tests/functional/agent/linux/test_ovsdb_monitor.py @@ -21,6 +21,7 @@ Tests in this module will be skipped unless: - sudo testing is enabled (see neutron.tests.functional.base for details) """ +import time from oslo_config import cfg @@ -129,6 +130,9 @@ class TestSimpleInterfaceMonitor(BaseMonitorTest): lambda: self._expected_devices_events(removed_devices, 'removed')) # restart self.monitor.stop(block=True) + # NOTE(slaweq): lets give async process few more seconds to receive + # "error" from the old ovsdb monitor process and then start new one + time.sleep(5) self.monitor.start(block=True, timeout=60) try: utils.wait_until_true(