Skip to content

Commit bb33ccf

Browse files
authored
bpo-30908: Fix dangling thread in test_os.TestSendfile (#2680) (#2844)
tearDown() now clears explicitly the self.server variable to make sure that the thread is completely cleared when tearDownClass() checks if all threads have been cleaned up. Fix the following warning: $ ./python -m test --fail-env-changed -m test.test_os.TestSendfile.test_keywords -R 3:1 test_os (...) Warning -- threading_cleanup() failed to cleanup 0 threads after 3 sec (count: 0, dangling: 2) (...) Tests result: ENV CHANGED (cherry picked from commit d1cc037)
1 parent 1daeb25 commit bb33ccf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Lib/test/test_os.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,6 +2621,7 @@ def tearDown(self):
26212621
self.client.close()
26222622
if self.server.running:
26232623
self.server.stop()
2624+
self.server = None
26242625

26252626
def sendfile_wrapper(self, sock, file, offset, nbytes, headers=[], trailers=[]):
26262627
"""A higher level wrapper representing how an application is

0 commit comments

Comments
 (0)