Reset the stored logs at each notification test steps
This is an atempt to solve a new appearance of bug 1813147 where the
long test_instance_action notification sample test case logs too much.
This patch drops the logs of each successful test step to try to avoid
the overload of the logging system.
Change-Id: I0e5db9b2f423ab92ff93b6b3aada7d6b79a7abf6
Related-Bug: #1813147
(cherry picked from commit 93027713ab
)
This commit is contained in:
parent
ed4a1ece04
commit
0956539edf
@ -182,6 +182,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.
|
||||
|
@ -407,6 +407,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(
|
||||
|
Loading…
Reference in New Issue
Block a user