Repository navigation
test: pause the coverage tracer while timing the self-restart scan - #37532
chenmingwei23 wants to merge 1 commit into
Conversation
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS This is a test-only change that can be reverted cleanly, and the quadratic-scan backstop still catches a planted quadratic by a wide margin. Notes
[DESIGN-REVIEWED] 2d790db Description read[DESCRIPTION-READ] 44ffc76f4eb465f3018db5067b48dc6ed185cbdc12fd1acc0f6b1e1ef9a2b06d That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
6b483fd to
2d790db
Compare
Code change approver recommendation: ApproveWhy: the decider estimates a 6% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. This PR changes one test and nothing else. Each timed reading of the self-restart scan now pauses the trace function with Restoring the tracer object returned by Design Review worried about coverage's sysmon core, where this pause would do nothing. That doesn't apply on this CI. Coverage is pinned to 7.10.6 and the shards run Python 3.12, and on 3.12 that version uses the settrace-based CTracer by default. Coverage of the security module is not lost: the call-count part of the same test runs without the pause and still goes through those lines. Backend Tests (3.12, 7), the shard this An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
|
This PR and #37530 both close #37515. Both change only |
Pull request was closed
Problem / Motivation
Goal:
test_the_scan_is_linear_not_quadraticmeasures the self-restart scan, not coverage's line tracer, so it stops going red on LinuxBackend Tests (3.12, 7)for PRs that never touch the scan.The test's 0.5 s CPU backstop is read while coverage traces every line. The CI shards run with
--cov, and the tracer multiplies the scan's CPU about five-fold, so a linear scan reads 0.6 to 0.7 s on a slower runner. Main itself is red on it (2k tokens took 0.677s), and the minimum of five readings does not help, because every traced reading is that slow.Why it matters
Every PR whose run lands on shard 7 goes red on a test it did not touch, and a rerun usually fails again. Authors either wait or rerun, and the red hides real failures on that shard.
Not a goal
thread_timebudgets in this file: they pass with headroom under coverage today.What changed (motivation → approach → change)
The backstop exists to catch a quadratic scan, so it should time the scan alone. Each timed reading now pauses the Python trace function (
sys.settrace(None)) and restores it afterwards. The scan's frames start after the pause, so none of them is traced. The bound, the five readings and the structural call-count checks are unchanged.Backwards compatibility
Test-only change. No product code changes.
Tests
Measured on one Linux host under
coverage(CTracer), 2,000 tokens, CPU seconds:The single test passes with and without
--cov=kiro_crewlocally.Manual verification
Not applicable: test-only change.
Screenshots / video
Not applicable: no UI change.
Related Issues
Fixes #37515
Related: #37446
Sibling sweep
The same file has four other
time.thread_time()budgets (the deny-rule backtracking checks). They pass under coverage with headroom and are left as they are.Pattern harvest
Checklist