summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-02-20 18:35:25 +0000
committerGerrit Code Review <review@openstack.org>2023-02-20 18:35:25 +0000
commit43f8e592c25443dfc8a58570623fd85e19ba6390 (patch)
treea5f66bbea64b0810cf6a5dc442eb2c38bfa709ef
parentd155a2b037ac7c727fa55b53442b420f1f68b6d5 (diff)
parent54501e7a24145aff318a6b5b1fa8b762a0e6b664 (diff)
downloadneutron-43f8e592c25443dfc8a58570623fd85e19ba6390.tar.gz
Merge "Fullstack: Wait placement process fixtrue to really stop" into stable/yoga
-rw-r--r--neutron/agent/common/async_process.py4
-rw-r--r--neutron/tests/fullstack/resources/process.py6
-rw-r--r--neutron/tests/fullstack/test_agent_bandwidth_report.py8
3 files changed, 18 insertions, 0 deletions
diff --git a/neutron/agent/common/async_process.py b/neutron/agent/common/async_process.py
index 41578418b7..7e27da68b1 100644
--- a/neutron/agent/common/async_process.py
+++ b/neutron/agent/common/async_process.py
@@ -95,6 +95,10 @@ class AsyncProcess(object):
def cmd(self):
return ' '.join(self._cmd)
+ @property
+ def is_running(self):
+ return self._is_running
+
def _reset_queues(self):
self._stdout_lines = eventlet.queue.LightQueue()
self._stderr_lines = eventlet.queue.LightQueue()
diff --git a/neutron/tests/fullstack/resources/process.py b/neutron/tests/fullstack/resources/process.py
index 647934a9e4..173710c63b 100644
--- a/neutron/tests/fullstack/resources/process.py
+++ b/neutron/tests/fullstack/resources/process.py
@@ -98,6 +98,12 @@ class ProcessFixture(fixtures.Fixture):
else:
return executor.submit(_restart)
+ def process_is_running(self):
+ return self.process.is_running
+
+ def process_is_not_running(self):
+ return not self.process_is_running()
+
class RabbitmqEnvironmentFixture(fixtures.Fixture):
diff --git a/neutron/tests/fullstack/test_agent_bandwidth_report.py b/neutron/tests/fullstack/test_agent_bandwidth_report.py
index 0b6d9bc475..6e9839f157 100644
--- a/neutron/tests/fullstack/test_agent_bandwidth_report.py
+++ b/neutron/tests/fullstack/test_agent_bandwidth_report.py
@@ -237,6 +237,14 @@ class TestPlacementBandwidthReport(base.BaseFullStackTestCase):
sleep=1)
self.environment.placement.process_fixture.stop()
+
+ placement_fixture = self.environment.placement.process_fixture
+ utils.wait_until_true(
+ predicate=functools.partial(
+ placement_fixture.process_is_not_running),
+ timeout=report_interval, sleep=1
+ )
+
_add_new_bridge_and_restart_agent(self.environment.hosts[0])
check_agent_not_synced = functools.partial(