]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-88352: Make TimedRotatingFileHandler tests more stable (GH-116409) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 11 Mar 2024 10:49:48 +0000 (11:49 +0100)
committerGitHub <noreply@github.com>
Mon, 11 Mar 2024 10:49:48 +0000 (12:49 +0200)
commit707ce1f0a7886c4e12c5c5de52a8c6c60b3c6c8c
tree62961424580abd39d08c69e159c09dc4937760bb
parent34e808ec6c167310ee8977df8934bcf3c5850c8f
[3.11] gh-88352: Make TimedRotatingFileHandler tests more stable (GH-116409) (GH-116586)

The tests failed (with less than 1% probability) if for example the file
was created at 11:46:03.999, but the record was emitted at 11:46:04.001,
with atTime=11:46:04, which caused an unexpected rollover. Ensure that the
tests are always run within the range of the same whole second.

Also share code between test_rollover_at_midnight and test_rollover_at_weekday.
(cherry picked from commit d8712fa0c75ad5ea56543903fa45674ab47cc647)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_logging.py