summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2010-02-08 21:18:15 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2010-02-08 21:18:15 (GMT)
commitcfc43e9435e4f7428f6dfb163ab8f3846dd3af28 (patch)
tree6aa71335fe437e7a26a4876c0ed129c67d01c52d
parentdde96e6dd6222e37746563930ff4bf3b1321f10e (diff)
downloadcpython-cfc43e9435e4f7428f6dfb163ab8f3846dd3af28.zip
cpython-cfc43e9435e4f7428f6dfb163ab8f3846dd3af28.tar.gz
cpython-cfc43e9435e4f7428f6dfb163ab8f3846dd3af28.tar.bz2
logging: gingerly re-enabling skipped tests after improving thread sync code in configurator.
-rw-r--r--Lib/logging/config.py8
-rw-r--r--Lib/test/test_logging.py2
2 files changed, 6 insertions, 4 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index fdf4397..1438388 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -803,6 +803,8 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
raise
except:
traceback.print_exc()
+ if self.server.ready:
+ self.server.ready.set()
except socket.error, e:
if not isinstance(e.args, tuple):
raise
@@ -819,12 +821,13 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
allow_reuse_address = 1
def __init__(self, host='localhost', port=DEFAULT_LOGGING_CONFIG_PORT,
- handler=None):
+ handler=None, ready=None):
ThreadingTCPServer.__init__(self, (host, port), handler)
logging._acquireLock()
self.abort = 0
logging._releaseLock()
self.timeout = 1
+ self.ready = ready
def serve_until_stopped(self):
import select
@@ -849,7 +852,8 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
self.ready = threading.Event()
def run(self):
- server = self.rcvr(port=self.port, handler=self.hdlr)
+ server = self.rcvr(port=self.port, handler=self.hdlr,
+ ready=self.ready)
self.ready.set()
global _listener
logging._acquireLock()
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 77db96a..dcd75ce 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -1594,7 +1594,6 @@ class ConfigDictTest(BaseTest):
logging.config.stopListening()
t.join(2.0)
- #@unittest.skip("See issue #7857")
def test_listen_config_10_ok(self):
with captured_stdout() as output:
self.setup_via_listener(json.dumps(self.config10))
@@ -1614,7 +1613,6 @@ class ConfigDictTest(BaseTest):
('ERROR', '4'),
], stream=output)
- @unittest.skip("See issue #7857")
def test_listen_config_1_ok(self):
with captured_stdout() as output:
self.setup_via_listener(textwrap.dedent(ConfigFileTest.config1))