You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2019/11/21 14:59:25 UTC
[qpid-dispatch] branch master updated: DISPATCH-1438: dump the
router debug dump file on router exit
This is an automated email from the ASF dual-hosted git repository.
kgiusti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/master by this push:
new 40303c2 DISPATCH-1438: dump the router debug dump file on router exit
40303c2 is described below
commit 40303c20834ab4ec8ef8c1c8afa548b29c8a13da
Author: Kenneth Giusti <kg...@apache.org>
AuthorDate: Fri Nov 8 14:59:29 2019 -0500
DISPATCH-1438: dump the router debug dump file on router exit
When the router is built for Debug (-DCMAKE_BUILD_TYPE=Debug) it
creates a dump file on shutdown that contains debug information. This
patch updates ctest to dump the file to stderr when the "-V" (verbose)
flag is used.
This closes #621
---
tests/system_test.py | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/tests/system_test.py b/tests/system_test.py
index 56094b6..ab8e987 100755
--- a/tests/system_test.py
+++ b/tests/system_test.py
@@ -399,7 +399,8 @@ class Qdrouterd(Process):
if not name: name = self.config.router_id
assert name
# setup log and debug dump files
- self.config.sections('router')[0]['debugDumpFile'] = '%s-qddebug.txt' % name
+ self.dumpfile = os.path.abspath('%s-qddebug.txt' % name)
+ self.config.sections('router')[0]['debugDumpFile'] = self.dumpfile
default_log = [l for l in config if (l[0] == 'log' and l[1]['module'] == 'DEFAULT')]
if not default_log:
config.append(
@@ -435,6 +436,20 @@ class Qdrouterd(Process):
super(Qdrouterd, self).teardown()
+ # check router's debug dump file for anything interesting (should be
+ # empty) and dump it to stderr for perusal by organic lifeforms
+ try:
+ if os.stat(self.dumpfile).st_size > 0:
+ with open(self.dumpfile) as f:
+ sys.stderr.write("\nRouter %s debug dump file:\n" % self.config.router_id)
+ sys.stderr.write(f.read())
+ sys.stderr.flush()
+ except OSError:
+ # failed to open file. This can happen when an individual test
+ # spawns a temporary router (i.e. not created as part of the
+ # TestCase setUpClass method) that gets cleaned up by the test.
+ pass
+
@property
def ports_family(self):
"""
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org