FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-88352: Make TimedRotatingFileHandler tests more stable by serhiy-storchaka · Pull Request #116409 · python/cpython · GitHub

Repository navigation

gh-88352: Make TimedRotatingFileHandler tests more stable - #116409

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:logging-flaky-tests
Mar 11, 2024
Merged

serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:logging-flaky-tests

Conversation

serhiy-storchaka commented Mar 6, 2024 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

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.

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.

erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Consider extracting the common test setup of test_rollover_at_midnight and test_rollover_at_weekday in a helper.

Copy link
Copy Markdown
Member Author

Actually, over 90% of code is shared between test_rollover_at_midnight and test_rollover_at_weekday. I thought that the refactored code could be too complicated, because the common code is mixed with the varying code, but it turned out pretty easy with only a boolean parameter.

erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Neat!

serhiy-storchaka merged commit d8712fa into python:main Mar 11, 2024

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

serhiy-storchaka deleted the logging-flaky-tests branch March 11, 2024 09:57
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 11, 2024
…onGH-116409)

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 d8712fa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

bedevere-app Bot commented Mar 11, 2024

Copy link
Copy Markdown

GH-116585 is a backport of this pull request to the 3.12 branch.

bedevere-app Bot removed the needs backport to 3.12 only security fixes label Mar 11, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 11, 2024
…onGH-116409)

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 d8712fa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

bedevere-app Bot commented Mar 11, 2024

Copy link
Copy Markdown

GH-116586 is a backport of this pull request to the 3.11 branch.

bedevere-app Bot removed the needs backport to 3.11 only security fixes label Mar 11, 2024
serhiy-storchaka added a commit that referenced this pull request Mar 11, 2024
…116409) (GH-116585)

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 d8712fa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Mar 11, 2024
…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 d8712fa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
…onGH-116409)

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.
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…onGH-116409)

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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL