[Python-checkins] bpo-30908: Fix dangling thread in test_os.TestSendfile (#2680) (#2845)

Victor Stinner webhook-mailer at python.org
Mon Jul 24 11:40:53 EDT 2017


https://github.com/python/cpython/commit/157b6ad677b7b330d30b2bb5ffbb2edac77b78cb
commit: 157b6ad677b7b330d30b2bb5ffbb2edac77b78cb
branch: 3.5
author: Victor Stinner <victor.stinner at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017年07月24日T17:40:47+02:00
summary:
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 d1cc037d1442cc35d1b194ec8e50901514360949)
files:
M Lib/test/test_os.py
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 8ad6d8e3117..bb5d2e3429c 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -2443,6 +2443,7 @@ def tearDown(self):
 self.client.close()
 if self.server.running:
 self.server.stop()
+ self.server = None
 
 def sendfile_wrapper(self, sock, file, offset, nbytes, headers=[], trailers=[]):
 """A higher level wrapper representing how an application is


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /