Fix test logging propagation 89/16089/5
authorjuraj.linkes <juraj.linkes@pantheon.tech>
Wed, 21 Nov 2018 12:13:39 +0000 (13:13 +0100)
committerDamjan Marion <dmarion@me.com>
Fri, 23 Nov 2018 13:36:06 +0000 (13:36 +0000)
When running tests with child processes the logs from child processes
would propagate to root logger, potentially resulting in some logs
being emitted twice. Fix this by disabling log propagation to parent
loggers in child processes.

Change-Id: I31eb265c2b7f7bceff627043956a67d6def3da2b
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
test/framework.py

index 4c536e0..4f830ba 100644 (file)
@@ -379,6 +379,7 @@ class VppTestCase(unittest.TestCase):
         cls.logger = get_logger(cls.__name__)
         if hasattr(cls, 'parallel_handler'):
             cls.logger.addHandler(cls.parallel_handler)
+            cls.logger.propagate = False
         cls.tempdir = tempfile.mkdtemp(
             prefix='vpp-unittest-%s-' % cls.__name__)
         cls.stats_sock = "%s/stats.sock" % cls.tempdir