mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
logging: gingerly re-enabling skipped tests after improving thread sync code in configurator.
This commit is contained in:
parent
dde96e6dd6
commit
cfc43e9435
2 changed files with 6 additions and 4 deletions
|
@ -803,6 +803,8 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
|
||||||
raise
|
raise
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
if self.server.ready:
|
||||||
|
self.server.ready.set()
|
||||||
except socket.error, e:
|
except socket.error, e:
|
||||||
if not isinstance(e.args, tuple):
|
if not isinstance(e.args, tuple):
|
||||||
raise
|
raise
|
||||||
|
@ -819,12 +821,13 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
|
||||||
allow_reuse_address = 1
|
allow_reuse_address = 1
|
||||||
|
|
||||||
def __init__(self, host='localhost', port=DEFAULT_LOGGING_CONFIG_PORT,
|
def __init__(self, host='localhost', port=DEFAULT_LOGGING_CONFIG_PORT,
|
||||||
handler=None):
|
handler=None, ready=None):
|
||||||
ThreadingTCPServer.__init__(self, (host, port), handler)
|
ThreadingTCPServer.__init__(self, (host, port), handler)
|
||||||
logging._acquireLock()
|
logging._acquireLock()
|
||||||
self.abort = 0
|
self.abort = 0
|
||||||
logging._releaseLock()
|
logging._releaseLock()
|
||||||
self.timeout = 1
|
self.timeout = 1
|
||||||
|
self.ready = ready
|
||||||
|
|
||||||
def serve_until_stopped(self):
|
def serve_until_stopped(self):
|
||||||
import select
|
import select
|
||||||
|
@ -849,7 +852,8 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
|
||||||
self.ready = threading.Event()
|
self.ready = threading.Event()
|
||||||
|
|
||||||
def run(self):
|
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()
|
self.ready.set()
|
||||||
global _listener
|
global _listener
|
||||||
logging._acquireLock()
|
logging._acquireLock()
|
||||||
|
|
|
@ -1594,7 +1594,6 @@ class ConfigDictTest(BaseTest):
|
||||||
logging.config.stopListening()
|
logging.config.stopListening()
|
||||||
t.join(2.0)
|
t.join(2.0)
|
||||||
|
|
||||||
#@unittest.skip("See issue #7857")
|
|
||||||
def test_listen_config_10_ok(self):
|
def test_listen_config_10_ok(self):
|
||||||
with captured_stdout() as output:
|
with captured_stdout() as output:
|
||||||
self.setup_via_listener(json.dumps(self.config10))
|
self.setup_via_listener(json.dumps(self.config10))
|
||||||
|
@ -1614,7 +1613,6 @@ class ConfigDictTest(BaseTest):
|
||||||
('ERROR', '4'),
|
('ERROR', '4'),
|
||||||
], stream=output)
|
], stream=output)
|
||||||
|
|
||||||
@unittest.skip("See issue #7857")
|
|
||||||
def test_listen_config_1_ok(self):
|
def test_listen_config_1_ok(self):
|
||||||
with captured_stdout() as output:
|
with captured_stdout() as output:
|
||||||
self.setup_via_listener(textwrap.dedent(ConfigFileTest.config1))
|
self.setup_via_listener(textwrap.dedent(ConfigFileTest.config1))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue