[ 
https://issues.apache.org/jira/browse/PROTON-2220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17126796#comment-17126796
 ] 

Jiri Daněk commented on PROTON-2220:
------------------------------------

The test is somewhat naive when it comes to attributing file descriptors to 
individual tests. If a test fails (with a leaked file descriptor) and a 
subsequent test passes, but the leaked file descriptor from before is closed by 
Python while the subsequent test was running, the following happens

{noformat}
======================================================================
FAIL: test_connection_close_all__do_not_check_test_broker 
(test_PROTON_2121_blocking_connection_fd_leak.BlockingConnectionFDLeakTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/foo/proton/python/tests/integration/test_PROTON_2121_blocking_connection_fd_leak.py",
 line 140, in test_connection_close_all__do_not_check_test_broker
    gc.collect()
  File "/usr/lib64/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File 
"/foo/proton/python/tests/integration/test_PROTON_2121_blocking_connection_fd_leak.py",
 line 59, in no_fd_leaks
    test.assertEqual(0, delta, "Found {0} new fd(s) after the 
test".format(delta))
AssertionError: Found -1 new fd(s) after the test
{noformat}

To fix this, instead of counting file descriptors, a set of file descriptor 
numbers can be maintained. The test fails if there are new entries present in 
such set at the end of test. This would end up ignoring "disappearing" file 
descriptors and should be more meaningful than the current acounting.

> Add tests for recently fixed leaks in Python binding
> ----------------------------------------------------
>
>                 Key: PROTON-2220
>                 URL: https://issues.apache.org/jira/browse/PROTON-2220
>             Project: Qpid Proton
>          Issue Type: Test
>          Components: python-binding
>    Affects Versions: proton-c-0.31.0
>            Reporter: Jiri Daněk
>            Assignee: Jiri Daněk
>            Priority: Major
>             Fix For: proton-c-0.32.0
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to