Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #449 +/- ##
==========================================
- Coverage 85.12% 81.56% -3.57%
==========================================
Files 21 21
Lines 2413 2484 +71
Branches 376 410 +34
==========================================
- Hits 2054 2026 -28
- Misses 259 343 +84
- Partials 100 115 +15 see 9 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Member
|
This will need to be rebased on main. |
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.
Fixes #445.
Use
PY_UNWIND, rather thanRAISEandRERAISE, to finish a frame's timing when an exception leaves it. A raise may be handled without leaving the frame or producing another line event. Clearing its timing record at that point loses work done before the next line.A concrete case is
with Context(): raise ValueError()on one source line, with an unprofiledContext.__exit__that does work. With a 30ms sleep in__exit__, the current monitoring backend charges almost no time to that line; legacy tracing charges the sleep there. The change retains that time and still clears the record when the exception actually unwinds the frame.Add eight context-exit cases covering direct raises, exceptions from an unprofiled callee, explicit reraises and exceptions during
finally, each with suppression on/off. Run them under both tracing backends. Check exit-time attribution, continuation, frame-state cleanup and exclusion of later idle time. Add two tests for existing unwind-callback forwarding and callback/event-mask restoration. Update the private callback documentation and changelog; the shared line-timing algorithm and legacy backend are unchanged.Local validation on Linux:
testsdirectory with the candidate: 287 passed / 44 skipped on 3.10.12; 327 passed / 3 skipped / 1 xfailed on 3.12.15; 331 passed on 3.13.17; 330 passed / 1 skipped on both 3.14.9 and 3.15.1. This includes the existing exception-line, recursive-call, generator/coroutine and trace-coexistence tests, plus the applicable Cython tests.git diff --checkpass. Ruff reports the same six existing warnings in the touched line-profiler test module as on the base.This is local validation, not a remote-CI or all-platform result. Each full run reports an existing unclosed-file warning in
test_docs_conf. Type and documentation checks, other operating systems and minimum-Cython compatibility were not run. No performance claim is made. Investigation, patch and tests were AI-assisted; independent human review is pending.