Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdb03cb9

Browse files
authored
[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 timeoutfrom 100 ms to 5 minutes (LONG_TIMEOUT).Replace also blocking wait() with wait(LONG_TIMEOUT) intest_output() to prevent the test to hang.(cherry picked from commited08238)
1 parent1bc1609 commitdb03cb9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎Lib/test/test_logging.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,25 +1981,25 @@ def test_output(self):
19811981
# The log message sent to the SysLogHandler is properly received.
19821982
logger=logging.getLogger("slh")
19831983
logger.error("sp\xe4m")
1984-
self.handled.wait()
1984+
self.handled.wait(support.LONG_TIMEOUT)
19851985
self.assertEqual(self.log_output,b'<11>sp\xc3\xa4m\x00')
19861986
self.handled.clear()
19871987
self.sl_hdlr.append_nul=False
19881988
logger.error("sp\xe4m")
1989-
self.handled.wait()
1989+
self.handled.wait(support.LONG_TIMEOUT)
19901990
self.assertEqual(self.log_output,b'<11>sp\xc3\xa4m')
19911991
self.handled.clear()
19921992
self.sl_hdlr.ident="h\xe4m-"
19931993
logger.error("sp\xe4m")
1994-
self.handled.wait()
1994+
self.handled.wait(support.LONG_TIMEOUT)
19951995
self.assertEqual(self.log_output,b'<11>h\xc3\xa4m-sp\xc3\xa4m')
19961996

19971997
deftest_udp_reconnection(self):
19981998
logger=logging.getLogger("slh")
19991999
self.sl_hdlr.close()
20002000
self.handled.clear()
20012001
logger.error("sp\xe4m")
2002-
self.handled.wait(0.1)
2002+
self.handled.wait(support.LONG_TIMEOUT)
20032003
self.assertEqual(self.log_output,b'<11>sp\xc3\xa4m\x00')
20042004

20052005
@unittest.skipUnless(hasattr(socket,"AF_UNIX"),"Unix sockets required")
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
``test_logging``: Fix ``test_udp_reconnection()`` by increasing the timeout
2+
from 100 ms to 5 minutes (LONG_TIMEOUT). Patch by Victor Stinner.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp