From b2c44c173c94c3a3f8afacd845fcd55a10f40ebf Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 7 Apr 2014 17:07:41 -0400 Subject: [PATCH] set api.extensions logging to ERROR in unit tests neutron.api.extensions generates a lot of output in a normal unit test run. It's responsible for > 80% of the lines in the subunit_log.txt. Logging each file load 10k times slows everything down, takes up valuable memory, and doesn't really help with testing. Instead we can set this to ERROR level in a fixture to ignore most of that logging and help make the unit tests run faster. Change-Id: I86b41f20342b4080859ee036220ddffa200f0562 (cherry picked from commit df96a03e6c74f1fceb4525900bca885307907b79) --- neutron/tests/base.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/neutron/tests/base.py b/neutron/tests/base.py index 9a0e89086..a65e89cab 100644 --- a/neutron/tests/base.py +++ b/neutron/tests/base.py @@ -95,6 +95,15 @@ class BaseTestCase(testtools.TestCase): nuke_handlers=capture_logs, )) + # suppress all but errors here + self.useFixture( + fixtures.FakeLogger( + name='neutron.api.extensions', + format=LOG_FORMAT, + level=logging.ERROR, + nuke_handlers=capture_logs, + )) + test_timeout = int(os.environ.get('OS_TEST_TIMEOUT', 0)) if test_timeout == -1: test_timeout = 0 -- 2.45.2