You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gm...@apache.org on 2020/07/29 13:20:57 UTC

[qpid-dispatch] branch master updated: DISPATCH-1722 - Fixed qdstat to display correct value of Worker Threads. Also, used regex to match output of qdstat instead of using string compare. This closes #782

This is an automated email from the ASF dual-hosted git repository.

gmurthy 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 3d0ba94  DISPATCH-1722 - Fixed qdstat to display correct value of Worker Threads. Also, used regex to match output of qdstat instead of using string compare. This closes #782
3d0ba94 is described below

commit 3d0ba94d29df1e5d2399c83dad287c9f5a6fd88c
Author: Ganesh Murthy <gm...@apache.org>
AuthorDate: Thu Jul 23 15:04:40 2020 -0400

    DISPATCH-1722 - Fixed qdstat to display correct value of Worker Threads. Also, used regex to match output of qdstat instead of using string compare. This closes #782
---
 tests/system_tests_qdstat.py | 37 +++++++++++++++++++++++--------------
 tools/qdstat.in              |  2 +-
 2 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/tests/system_tests_qdstat.py b/tests/system_tests_qdstat.py
index 30fc237..40b4bf1 100644
--- a/tests/system_tests_qdstat.py
+++ b/tests/system_tests_qdstat.py
@@ -66,24 +66,33 @@ class QdstatTest(system_test.TestCase):
 
     def test_general(self):
         out = self.run_qdstat(['--general'], r'(?s)Router Statistics.*Mode\s*Standalone')
-        self.assertTrue("Connections                      1" in out)
-        self.assertTrue("Nodes                            0" in out)
-        self.assertTrue("Auto Links                       0" in out)
-        self.assertTrue("Link Routes                      0" in out)
-        self.assertTrue("Worker Threads                   1" in out)
-        self.assertTrue("Router Id                        QDR.A" in out)
-        self.assertTrue("Mode                             standalone" in out)
+
+        self.assertTrue(re.match(r"(.*)\bConnections\b[ \t]+\b1\b(.*)",
+                                 out, flags=re.DOTALL) is not None, out)
+        self.assertTrue(re.match(r"(.*)\bNodes\b[ \t]+\b0\b(.*)",
+                                 out, flags=re.DOTALL) is not None, out)
+        self.assertTrue(re.match(r"(.*)\bAuto Links\b[ \t]+\b0\b(.*)",
+                                 out, flags=re.DOTALL) is not None, out)
+        self.assertTrue(re.match(r"(.*)\bLink Routes\b[ \t]+\b0\b(.*)",
+                                 out, flags=re.DOTALL) is not None, out)
+        self.assertTrue(re.match(r"(.*)\bWorker Threads\b[ \t]+\b1\b(.*)",
+                                 out, flags=re.DOTALL) is not None, out)
+        self.assertTrue(re.match(r"(.*)\bRouter Id\b[ \t]+\bQDR.A\b(.*)",
+                                 out, flags=re.DOTALL) is not None, out)
+        self.assertTrue(re.match(r"(.*)\bMode\b[ \t]+\bstandalone\b(.*)",
+                                 out, flags=re.DOTALL) is not None, out)
+
         self.assertEqual(out.count("QDR.A"), 2)
 
     def test_general_csv(self):
         out = self.run_qdstat(['--general', '--csv'], r'(?s)Router Statistics.*Mode","Standalone')
-        self.assertTrue("Connections","1" in out)
-        self.assertTrue("Worker Threads", "1" in out)
-        self.assertTrue("Nodes","0" in out)
-        self.assertTrue("Auto Links","0" in out)
-        self.assertTrue("Link Routes","0" in out)
-        self.assertTrue("Router Id","QDR.A" in out)
-        self.assertTrue("Mode","standalone" in out)
+        self.assertIn('"Connections","1"', out)
+        self.assertIn('"Worker Threads","1"', out)
+        self.assertIn('"Nodes","0"', out)
+        self.assertIn('"Auto Links","0"', out)
+        self.assertIn('"Link Routes","0"', out)
+        self.assertIn('"Router Id","QDR.A"', out)
+        self.assertIn('"Mode","standalone"', out)
         self.assertEqual(out.count("QDR.A"), 2)
 
     def test_connections(self):
diff --git a/tools/qdstat.in b/tools/qdstat.in
index 4326ed0..5b423c4 100755
--- a/tools/qdstat.in
+++ b/tools/qdstat.in
@@ -325,7 +325,7 @@ class BusManager(Node):
         rows.append(('Mode',           router.mode))
         rows.append(('Router Id',      router.id))
         try:
-            rows.append(('Worker Threads', router.workerThreads))
+            rows.append(('Worker Threads', PlainNum(router.workerThreads)))
         except:
             pass
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org