Skip to content

Fix timeout resets to use the call-time clock - #756

Draft
Kayvan-Zahiri wants to merge 1 commit into
linode:devfrom
Kayvan-Zahiri:codex/reset-timeout-start-at-call-time
Draft

Kayvan-Zahiri wants to merge 1 commit into
linode:devfrom
Kayvan-Zahiri:codex/reset-timeout-start-at-call-time

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

📝 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant