Title: test_rollover_based_on_st_birthtime_only fails on slow CI: rotated file is outside the fixed 5-second search window · Issue #157161 · python/cpython · GitHub
Open Graph Title: test_rollover_based_on_st_birthtime_only fails on slow CI: rotated file is outside the fixed 5-second search window · Issue #157161 · python/cpython
X Title: test_rollover_based_on_st_birthtime_only fails on slow CI: rotated file is outside the fixed 5-second search window · Issue #157161 · python/cpython
Description: Bug report Bug description: test_rollover_based_on_st_birthtime_only failed again on main, on the "Windows / Build and test (x64, tail-call)" CI job of 532b9db (2026-09-01): https://github.com/python/cpython/actions/runs/33523218872/job/...
Open Graph Description: Bug report Bug description: test_rollover_based_on_st_birthtime_only failed again on main, on the "Windows / Build and test (x64, tail-call)" CI job of 532b9db (2026-09-01): https://github.com/pyth...
X Description: Bug report Bug description: test_rollover_based_on_st_birthtime_only failed again on main, on the "Windows / Build and test (x64, tail-call)" CI job of 532b9db (2026-09-01): https://githu...
Opengraph URL: https://github.com/python/cpython/issues/157161
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_rollover_based_on_st_birthtime_only fails on slow CI: rotated file is outside the fixed 5-second search window","articleBody":"# Bug report\n\n### Bug description:\n\n`test_rollover_based_on_st_birthtime_only` failed again on main, on the \"Windows / Build and test (x64, tail-call)\" CI job of 532b9dbd67 (2026-09-01): https://github.com/python/cpython/actions/runs/33523218872/job/99907492032\n\n```\nFAIL: test_rollover_based_on_st_birthtime_only (test.test_logging.TimedRotatingFileHandlerTest.test_rollover_based_on_st_birthtime_only)\nAssertionError: False is not true : No rotated files found, went back 5 seconds\n```\n\nThis is the test that gh-150960 (fixed by GH-150954, which widened the search from 5 to 6 timestamps) was about. The diagnostics the test prints show why it still fails on a slow machine:\n\n```\nTest time: 2026-09-01 15-10-51\nThe only matching files are: ['test_logging-2-p8i89g4b.log', 'test_logging-2-p8i89g4b.log.2026-09-01_15-10-45']\nContents of test_logging-2-p8i89g4b.log:\n2026-09-01 15:10:51,079 testing - new record supposedly in the new file after rollover\nContents of test_logging-2-p8i89g4b.log.2026-09-01_15-10-45:\n2026-09-01 15:10:45,004 testing - initial\n2026-09-01 15:10:47,105 testing - update before rollover to renew the st_mtime\n```\n\nThe rollover happened and is correct. The rotated file is named after the start of the interval, which is the creation time of the log file (`TimedRotatingFileHandler.__init__()` computes `rolloverAt` from `min(creation_time, modification_time)`, and `doRollover()` uses `rolloverAt - interval` for the suffix), so its suffix is `15-10-45`. The test then looks for a rotated file with a timestamp between `now` and `now - 5 s`. `now` was `15:10:51`, six seconds after the file was created, because the third `add_record()` came 3.97 s after the second one instead of about 2.1 s. So the file with suffix `15-10-45` was one second outside the window.\n\nThe test's timing (two `time.sleep(2.1)` calls plus three handler set-ups and emits) is nominally 4.2 s, and any slowdown of more than 0.8 s pushes the rotated file out of the fixed 5-second window. The window should be derived from the time the test actually took, since the suffix can never be older than the moment the log file was created.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nWindows (CI)\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-157162\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/iamsharduld","@type":"Person","name":"iamsharduld"},"datePublished":"2026-09-08T04:44:41Z","url":"https://github.com/python/cpython/issues/157161"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3adf0396-200b-b77c-3727-d4ea81852d93 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D796:17543D:32434C:3FD259:6B01F9E7 |
| html-safe-nonce | 8c65615203f36b119abe7227ab70f27626292f4ed3157832e05c41f1af0ed381 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzk2OjE3NTQzRDozMjQzNEM6M0ZEMjU5OjZCMDFGOUU3IiwidmlzaXRvcl9pZCI6IjMyMzAzNjEwOTI1NzIxODMwMTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 768a5f4f21fd0290bccabbaa245814feec92eb3ec9a9ac7941dc5e4770d9782f |
| hovercard-subject-tag | issue:5382166407 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/157161/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e30f5a2d72e0699ad68363c123536920c47130fb2de20e6513d09407e4126124/python/cpython/issues/157161 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e30f5a2d72e0699ad68363c123536920c47130fb2de20e6513d09407e4126124/python/cpython/issues/157161 |
| og:image:alt | Bug report Bug description: test_rollover_based_on_st_birthtime_only failed again on main, on the "Windows / Build and test (x64, tail-call)" CI job of 532b9db (2026-09-01): https://github.com/pyth... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | iamsharduld |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width