summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-07-25 14:49:32 (GMT)
committerGitHub <noreply@github.com>2023-07-25 14:49:32 (GMT)
commitdb03cb953a26970e1affe4e8fc7a8da79a3d229a (patch)
treec68190071fd5c2c250e7b32600b558d90ecd1d58 /Lib/test/test_logging.py
parent1bc160947ea58fb3d11fa8667266bc80e9a14b7f (diff)
downloadcpython-db03cb953a26970e1affe4e8fc7a8da79a3d229a.zip
cpython-db03cb953a26970e1affe4e8fc7a8da79a3d229a.tar.gz
cpython-db03cb953a26970e1affe4e8fc7a8da79a3d229a.tar.bz2
[3.11] gh-107237: Fix test_udp_reconnection() of test_logging (#107238) (#107245)
gh-107237: Fix test_udp_reconnection() of test_logging (#107238) test_logging: Fix test_udp_reconnection() by increasing the timeout from 100 ms to 5 minutes (LONG_TIMEOUT). Replace also blocking wait() with wait(LONG_TIMEOUT) in test_output() to prevent the test to hang. (cherry picked from commit ed082383272c2c238e364e9cc83229234aee23cc)
Diffstat (limited to 'Lib/test/test_logging.py')
-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 76bd872..f1f2b75 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -1981,17 +1981,17 @@ class SysLogHandlerTest(BaseTest):
# The log message sent to the SysLogHandler is properly received.
logger = logging.getLogger("slh")
logger.error("sp\xe4m")
- self.handled.wait()
+ self.handled.wait(support.LONG_TIMEOUT)
self.assertEqual(self.log_output, b'<11>sp\xc3\xa4m\x00')
self.handled.clear()
self.sl_hdlr.append_nul = False
logger.error("sp\xe4m")
- self.handled.wait()
+ self.handled.wait(support.LONG_TIMEOUT)
self.assertEqual(self.log_output, b'<11>sp\xc3\xa4m')
self.handled.clear()
self.sl_hdlr.ident = "h\xe4m-"
logger.error("sp\xe4m")
- self.handled.wait()
+ self.handled.wait(support.LONG_TIMEOUT)
self.assertEqual(self.log_output, b'<11>h\xc3\xa4m-sp\xc3\xa4m')
def test_udp_reconnection(self):
@@ -1999,7 +1999,7 @@ class SysLogHandlerTest(BaseTest):
self.sl_hdlr.close()
self.handled.clear()
logger.error("sp\xe4m")
- self.handled.wait(0.1)
+ self.handled.wait(support.LONG_TIMEOUT)
self.assertEqual(self.log_output, b'<11>sp\xc3\xa4m\x00')
@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")