summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-02-05 08:21:08 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-02-05 08:21:08 (GMT)
commit55cd82fe0adc0a7ceb93eb1b6e9de6a25fd7adb9 (patch)
tree2570a8e862a3e9a7fe6c49f0728d5a390a417558 /Lib/test
parent0e6bc8c260f640ceee515e9873353778472e0a00 (diff)
downloadcpython-55cd82fe0adc0a7ceb93eb1b6e9de6a25fd7adb9.zip
cpython-55cd82fe0adc0a7ceb93eb1b6e9de6a25fd7adb9.tar.gz
cpython-55cd82fe0adc0a7ceb93eb1b6e9de6a25fd7adb9.tar.bz2
Get test_logging to not hang when running under regrtest.py -R ::
Not sure why/how _handlers/_handlerList is out of sync. This could indicate a deeper problem. In test_logging, the only absolutely necessary change to get working was tcpserver.abort = 1. But we don't want to wait infinitely to join the threads, so give a 2.0 second timeout. There doesn't appear to be a need for a local abort variable in serve_until_stopped, so just use the instance member. Note the problem is only on HEAD, not in 2.4.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_logging.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 799f059..bcebc83 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -99,14 +99,12 @@ class LogRecordSocketReceiver(ThreadingTCPServer):
self.timeout = 1
def serve_until_stopped(self):
- abort = 0
- while not abort:
+ while not self.abort:
rd, wr, ex = select.select([self.socket.fileno()],
[], [],
self.timeout)
if rd:
self.handle_request()
- abort = self.abort
#notify the main thread that we're about to exit
socketDataProcessed.set()
# close the listen socket
@@ -620,8 +618,10 @@ def test_main_inner():
finally:
#wait for TCP receiver to terminate
socketDataProcessed.wait()
+ # ensure the server dies
+ tcpserver.abort = 1
for thread in threads:
- thread.join()
+ thread.join(2.0)
banner("logrecv output", "begin")
sys.stdout.write(sockOut.getvalue())
sockOut.close()