Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 107 107
=========================================
Hits 107 107
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Pre-release fixes for v0.6.0: correct callback order in
Timer.__enter__, make the CPU-bound block scenario stable, and simplify the BDD step layout (remove utils.py, centralize shared steps).Summary of Change
1. Library: invoke
on_startbefore recording timestamps (timerun.py)Timer.__enter__,on_start(measurement)is now invoked before recordingperf_counter_ns()andprocess_time_ns().2. Tests: fix flaky CPU-bound scenario
block_timing_steps.pyfor this case; other scenarios still use the shared "within buffer" step fromcommon_steps.py.with" step now uses a process-time spin (process_time_ns()) for CPU-bound operations instead of the old wall-time spin fromutils.py, so the scenario actually exercises CPU time.3. Test structure and docs
features/steps/utils.py: Inlined or moved helpers intocommon_steps.py.BUFFER_NSand the "within buffer" / "which measurement" logic live incommon_steps.py; sleep/spin in step files usetime.sleep/time.process_time_ns()directly.common_steps.py: Clarified as "steps shared by more than one feature." Added_measurement(context, which)and parameterized steps so one implementation supports "the measurement's…" and "the first/second/outer/inner measurement's…" (wall time within buffer, metadata key). Minor comment and structure cleanup; CPU lower slack inlined as1_000_000ns.block_timing_steps.py: Usescommon_stepsfor shared steps; only block-specific steps and the new "at least" wall step remain here. Sleep/spin viatimeonly.function_timing_steps.py: Replacedsleep_wall_at_leastwithtime.sleep(...); no dependency onutils.py. Light comment/formatting cleanup.measurement_steps.py: Empty-metadata assertion simplified toassert context.measurement.metadata == {}.YOUR_USERNAME; feature layout description updated (noutils.py; shared steps incommon_steps.py).measurements" for clarity.Checklist
make lint testand both pass