Merge "Fullstack: Wait placement process fixtrue to really stop"

This commit is contained in:
Zuul 2023-01-26 13:31:15 +00:00 committed by Gerrit Code Review
commit 24d8c1baa6
3 changed files with 18 additions and 0 deletions

View File

@ -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()

View File

@ -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):

View File

@ -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(