You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jd...@apache.org on 2020/05/26 21:54:54 UTC

[qpid-proton] branch master updated: PROTON-2220 [python] fix new tests that proved to be flaky (#251)

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

jdanek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/master by this push:
     new db01c09  PROTON-2220 [python] fix new tests that proved to be flaky (#251)
db01c09 is described below

commit db01c09748ff950d454c9d777de16cf442e37631
Author: Jiri Daněk <jd...@redhat.com>
AuthorDate: Tue May 26 23:54:46 2020 +0200

    PROTON-2220 [python] fix new tests that proved to be flaky (#251)
---
 ...t_PROTON_2111_container_ssl_ssldomain_object_leak.py |  4 +---
 .../test_PROTON_2121_blocking_connection_fd_leak.py     | 17 +++++++++++------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/python/tests/integration/test_PROTON_2111_container_ssl_ssldomain_object_leak.py b/python/tests/integration/test_PROTON_2111_container_ssl_ssldomain_object_leak.py
index b8a0f2a..d0d8533 100644
--- a/python/tests/integration/test_PROTON_2111_container_ssl_ssldomain_object_leak.py
+++ b/python/tests/integration/test_PROTON_2111_container_ssl_ssldomain_object_leak.py
@@ -141,8 +141,6 @@ class Proton2111Test(unittest.TestCase):
         client_ssl_domain.set_trusted_ca_db(certificate_db)
         client_ssl_domain.set_peer_authentication(proton.SSLDomain.VERIFY_PEER)
 
-        # client_ssl_domain.set_peer_authentication(proton.SSLDomain.VERIFY_PEER_NAME)
-
         def send_msg(msg_id, urls):
             container = proton.reactor.Container(SampleSender(msg_id, urls, client_ssl_domain))
             container.run()
@@ -165,4 +163,4 @@ class Proton2111Test(unittest.TestCase):
         diffs = [c - object_counts[0] for c in object_counts]
         for diff in diffs:
             # allow for random variation from initial value on some systems, but prohibit linear growth
-            self.assertTrue(diff <= 30, "Object counts should not be increasing: {0}".format(diffs))
+            self.assertTrue(diff <= 50, "Object counts should not be increasing: {0}".format(diffs))
diff --git a/python/tests/integration/test_PROTON_2121_blocking_connection_fd_leak.py b/python/tests/integration/test_PROTON_2121_blocking_connection_fd_leak.py
index 954d679..dd6dcbe 100644
--- a/python/tests/integration/test_PROTON_2121_blocking_connection_fd_leak.py
+++ b/python/tests/integration/test_PROTON_2121_blocking_connection_fd_leak.py
@@ -31,6 +31,7 @@ import gc
 import os
 import subprocess
 import threading
+import warnings
 
 import cproton
 
@@ -49,12 +50,16 @@ def count_fds():
 @contextlib.contextmanager
 def no_fd_leaks(test):
     # type: (unittest.TestCase) -> None
-    before = count_fds()
-    yield
-    delta = count_fds() - before
-    if delta != 0:
-        subprocess.check_call("ls -lF /proc/{0}/fd/".format(os.getpid()), shell=True)
-        test.assertEqual(0, delta, "Found {0} new fd(s) after the test".format(delta))
+    with warnings.catch_warnings(record=True) as ws:
+        before = count_fds()
+        yield
+        delta = count_fds() - before
+        if delta != 0:
+            subprocess.check_call("ls -lF /proc/{0}/fd/".format(os.getpid()), shell=True)
+            test.assertEqual(0, delta, "Found {0} new fd(s) after the test".format(delta))
+
+        if len(ws) > 0:
+            test.fail([w.message for w in ws])
 
 
 class Broker(proton.handlers.MessagingHandler):


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