Merge "Reset the stored logs at each notification test steps"

This commit is contained in:
Zuul 2019-06-03 19:25:28 +00:00 committed by Gerrit Code Review
commit b6f1c314c7
2 changed files with 11 additions and 0 deletions

View File

@ -188,6 +188,12 @@ class StandardLogging(fixtures.Fixture):
self.useFixture(
fixtures.MonkeyPatch('oslo_log.log.setup', fake_logging_setup))
def delete_stored_logs(self):
# NOTE(gibi): this depends on the internals of the fixtures.FakeLogger.
# This could be enhanced once the PR
# https://github.com/testing-cabal/fixtures/pull/42 merges
self.logger._output.truncate(0)
class OutputStreamCapture(fixtures.Fixture):
"""Capture output streams during tests.

View File

@ -409,6 +409,11 @@ class TestInstanceNotificationSample(
# Ensure that instance is in active state after an action
self._wait_for_state_change(self.admin_api, server, 'ACTIVE')
# if the test step did not raised then we consider the step as
# succeeded. We drop the logs to avoid causing subunit parser
# errors due to logging too much at the end of the test case.
self.stdlog.delete_stored_logs()
def test_create_delete_server(self):
fake_trusted_certs = ['cert-id-1', 'cert-id-2']
server = self._boot_a_server(