Skip to content

Commit 157b6ad

Browse files
authored
bpo-30908: Fix dangling thread in test_os.TestSendfile (#2680) (#2845)
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 dbe6aba commit 157b6ad

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
@@ -2443,6 +2443,7 @@ def tearDown(self):
24432443
self.client.close()
24442444
if self.server.running:
24452445
self.server.stop()
2446+
self.server = None
24462447

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

0 commit comments

Comments
 (0)