Repository navigation
test: remove flaky cross-file timestamp assertion in multiprocess rotation test - #1335
Conversation
…ation test Remove file_ts_bounds cross-file timestamp ordering checks in test_get_logger_with_params_multiprocess_rotation_concurrency. Python logging captures LogRecord.created before MultiProcessRotatingFileHandler acquires its file lock, so concurrent workers can legitimately flush a record a few milliseconds older into a newly rotated file. Deterministic rotation order is already covered by per-worker monotonic msg sequence checks. Fixes #1334 Assisted-by: PI (gemini-4-neon) Signed-off-by: Meni Yakove <myakove@gmail.com>
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
PR Summary by Qodotest: remove flaky cross-file timestamp assertion in rotation test
AI Description
Merge Risk
|
Code Review by Qodo
1.
|
|
/qodo dismiss finding 1 By design: cross-worker wall-clock timestamps are intentionally not compared across rotated files because Python's Assisted-by: PI (gemini-4-neon) |
Dismissed The by-design rationale holds up against the diff: the removed loop compared wall-clock timestamps across files, which are not monotonic across workers because |
|
/approve Verification at
|
|
New container for ghcr.io/myk-org/github-webhook-server:latest published |
Summary
Removes the flaky
file_ts_boundscross-file millisecond/microsecond timestamp ordering assertions fromTestHelpers.test_get_logger_with_params_multiprocess_rotation_concurrencyinwebhook_server/tests/test_helpers.py.Root cause
Python's
loggingcapturesLogRecord.createdbeforeMultiProcessRotatingFileHandleracquires its inter-process file lock and performs writes or rollovers. With 4 forked workers logging concurrently, a worker can construct a record, wait on the lock while another worker writes a newer record and rotates the log, and then flush its slightly older timestamp into the new file. That caused intermittent failures in CI (seen on PR #1333, check run142150288731).Cross-worker wall-clock timestamps are intentionally not compared across rotated files because
LogRecord.createdreflects pre-lock record creation time rather than write order.What remains verified
assert lines).datetime.fromisoformat(ts_str)).msg=sequence numbers strictly increase across rotated files into the base log, verifying per-worker chronological order across rotations without clock comparisons.msg=059final markers land in the base log only, and all rotated backups exceed 1000 bytes.Verification
test_get_logger_with_params_multiprocess_rotation_concurrency(20x loop): 20/20 passeduvx prek run --all-files: passeduvx tox:unused-codeOK,unittests2499 passed (91.59% coverage)Fixes #1334
Assisted-by: PI (gemini-4-neon)