Repository navigation
Fix timeout resets to use the call-time clock - #756
Draft
Kayvan-Zahiri wants to merge 1 commit into
Draft
Kayvan-Zahiri wants to merge 1 commit into
Kayvan-Zahiri wants to merge 1 commit into
Conversation
This branch has not been deployed
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
TimeoutContext.start() currently captures datetime.now() in its default argument when polling.py is imported. Calling start() later reuses that old timestamp and can leave an expired context expired, contrary to the documented reset behavior.
Use None as the default and evaluate the current time inside start(). Preserve caller-supplied timestamps. Clarify when the default timestamp is evaluated.
This is an external community contribution without an internal TPT ticket. Please apply the documented community-contribution label for the CI title exemption; no ticket identifier has been invented. Target: dev.
✔️ How to Test
The regression uses a controlled clock to expire a context, restart it, and repeat the restart at a later time. An explicit-start-time control preserves backdated behavior. Before: regression fails, control passes. After: make test-unit passes all 519 mocked tests.
make lint completes successfully, including wheel/sdist builds, full Black/isort/autoflake checks, pylint and Twine metadata validation. Pylint reports existing deprecated/unrecognized configuration-option warnings while returning success and rating source 10/10. Generated version.py is restored after the build. git diff --check passes.
Python3.12/macOS with declared extras in an isolated environment. No live integration/smoke tests, credentials, cloud resource creation or full Python/OS matrix.