Repository navigation
Remove hook-call monitors independently of undo order - #814
Open
rupayon123 wants to merge 3 commits into
Open
rupayon123 wants to merge 3 commits into
rupayon123 wants to merge 3 commits into
Conversation
rupayon123
marked this pull request as ready for review
October 28, 2026 12:49
Author
|
I updated the lifetime test to call both monitors before checking that their callbacks are released, and simplified undo around the active-token invariant. The full 260 tests, 68 focused tests and all pinned hooks pass. Every changed line and branch is covered locally; hosted coverage for this commit still needs to run. The benchmark failure also occurs on unchanged base with the job's pytest 9.2.0 and pytest-benchmark 5.3.0 versions: the fixture accesses the removed |
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.
Undoing an earlier hook-call monitor currently removes later monitors, and later undo calls can restore callbacks that were already removed. Keep a persistent execution chain so each undo removes only its own monitor, repeated undo stays harmless, and in-flight calls retain their original before/after pairing.
The lifetime regression invokes active callbacks before checking their release. Undo traversal now expresses the internal invariant that every active token remains in the chain; directly replacing the private
_inner_hookexecwhile monitors are active fails that assertion. Existing public tracing/monitoring lifecycles, custom original executors, nested calls and result/exception handling remain covered. Includes the numbered changelog fragment.Validation on macOS arm64:
_caller.pybranch remains uncovered locally.Function._nodeid. Local reproduction uses Python 3.10.17; the hosted job uses 3.10.22 on Linux. No benchmark, dependency, coverage threshold or configuration was changed.Hosted checks for the latest repair still need verification. No cross-thread registration/undo guarantee is added.