Repository navigation
test: retire two shared-runner flakes in reconcile and lease-scan tests - #14940
Conversation
test_a_descendant_only_record_is_retracted_from_the_descendant_file pins the live sibling's start token instead of asking the real probe, which on Windows opens pid 5500 for pid 5502 and calls the row recycled. test_lease_scan_stops_on_its_deadline_and_answers_uncertain scopes its call-count fake clock to the skill_projection module so a neighbour thread reading time.monotonic() cannot consume the schedule. Fixes #14937 Fixes #14938
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] e75c1cb Description read[DESCRIPTION-READ] bc76da9bbab7f98163df90cc8156414e888bc2065f1fae3edac177f5c2fd0b70 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 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: |
Problem / Motivation
Goal: Two backend tests stop failing on unrelated PRs when a shared CI runner happens to hold pid 5500 or reads the clock from another thread.
Both tests fail and then pass on a rerun of the same commit. In the last three days
test_a_descendant_only_record_is_retracted_from_the_descendant_filefailed twice onBackend Tests (Windows) (1)andtest_lease_scan_stops_on_its_deadline_and_answers_uncertainfailed once onBackend Tests (3.12, 2), each time red on a PR that touched neither file.Why it matters
A false red on a backend shard costs every PR that hashes into it a rerun, and the failure text points at the reconciler and the lease scan rather than at the test, so the first reading is always "this PR broke process cleanup".
Not a goal
runtime_reconcile.pyorskill_projection.py; both behave correctly when the tests fire.What changed (motivation → approach → change)
test_runtime_reconcile.py::test_a_descendant_only_record_is_retracted_from_the_descendant_fileOpenProcess(5502)opens pid 5500, so the real start-time probe answers a stranger's identity and the live sibling's row is retracted as recycledsession_pid._pid_start_tokento the tokens the rows record, like every other reconciler test in the filetest_native_skill_projection.py::test_lease_scan_stops_on_its_deadline_and_answers_uncertaintime.monotonic, so one read from a neighbour thread spent the schedule before the first entryprojection.timewith a module-scoped shim, the same shape #14535 gave the wait-tool keepalive testBoth tests keep their assertions. Only the seam each one patches moves.
Backwards compatibility
Compatible: test-only change, no production code touched.
Tests
The two changed tests are the tests. Each failure was reproduced on Linux by injecting its CI condition (a stranger start token; a thread spinning on
time.monotonic()): the old tests fail 3/3, the changed tests pass 3/3.Manual verification
N/A — the reproduction above is the verification.
Related Issues
Fixes #14937
Fixes #14938
Pattern harvest
Rule candidate: review-prompt
Pattern: a test that installs a fake clock keyed on call count on the global
timemodule, or that records a pid identity token and leaves the recycle probe live.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)