Repository navigation
Conversation
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS The fix makes the release depend on how many lock waits have expired, not on wall-clock time, which removes the flake's cause; it changes test code only. Notes
[DESIGN-REVIEWED] 2175a17 Description read[DESCRIPTION-READ] 6f3b98005c7cde970523186cc3b851840254056593acd2bf82220869a175de43 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 (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
On the red Readiness: none of the cancelled Backend Tests (3.12) shards (1, 3, 6, 7) failed a test. Each was stopped at the 60-minute job limit. Shard 7's log shows the leaf corpus gate group alone at |
59b2551 to
e3f44d8
Compare
e3f44d8 to
c713f37
Compare
test_a_holder_that_outlasts_the_wait_is_waited_for_not_given_up_on released the holder on a 0.45 s timer and asserted at least two expired 0.1 s waits. On a loaded runner the time before the first wait began used up most of that window, so only one wait expired. Release from inside the wait loop instead, when the second "still waiting" WARNING is logged, so the count no longer depends on the wall clock. Fixes kirodotdev#23363 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c713f37 to
2175a17
Compare
|
Thanks for this PR. On head 2175a17 the red is Backend Tests (3.12, 5): the job hit its 1h10m time limit and was cancelled, and Coverage Gate fails after it. That job has already been re-run several times on the same merge base with the same result, and this diff does not touch the tests in that shard. Main has changed since these runs, including the setup of the end-to-end decisions tests that were failing in shard 5 on other PRs the same day (#29623). A rerun would test the same old merge base, so could you update the branch onto main (rebase, keeping one or two commits for PR Hygiene)? CI will then run against the current base. |
|
Thanks @leonlaiyc for this fix! The fork CI test shards for this PR kept hitting the 70-minute runner limit (#23450), so I opened #30818 with your exact commit (authorship kept) from an in-repo branch, where CI runs on the larger runners. This PR stays open; review and CI continue in #30818. |
|
Thank you, @leonlaiyc! Your change landed on main through the in-repo copy #30818 (your commit and authorship kept), which ran CI on the larger runners. Closing this one as merged-via-copy. |
Problem / Motivation
Goal:
test_a_holder_that_outlasts_the_wait_is_waited_for_not_given_up_onpasses or fails on what the prune lock wait does, not on how fast the CI runner is.The test failed on Windows shard 7/8 of #23334 with
assert 1 >= 2(#23363). It held the prune lock in a thread, released it onthreading.Timer(0.45, release.set)and assertedreport.lock_waits >= 2withPRUNE_LOCK_WAIT_S = 0.1. That counts expired waits against wall-clock time: on a loaded runner the time before the first wait begins can use up most of the 0.45 s, so only one wait expires.Why it matters
The test guards the rule that a contending prune pass never gives up while another process holds the lock, which keeps a session from binding a crewmate the holder has not judged yet. A red it produces on unrelated PRs costs a rerun each time, and it teaches people to ignore that test.
Not a goal
crewmate_prune_migration.pyorPRUNE_LOCK_WAIT_S.What changed (motivation → approach → change)
assert report.lock_waits >= 2sees 1 on a loaded Windows runner.mig.logger.warningand counts thecrewmate prune still waitingWARNING, which the loop logs once per expired wait, right afterreport.lock_waits += 1. On the second one it setsrelease, so the holder lets go only after two waits have expired, whatever the runner speed. Thethreading.Timeris gone. The test also asserts the holder thread finished. Every other assertion is unchanged.Backwards compatibility
Compatible: test-only change. No production code is touched.
Removes nothing: the test keeps every assertion it had.
Tests
Proof: not provable -- test-only change
releasewould then never be set, the contender would return withlock_waits == 1, andassert report.lock_waits >= 2would fail. So the test still checks the no-give-up rule, and the count it asserts now follows from the release condition instead of from timing.test_crewmate_prune_migration.pyplustest_flake_pattern_ratchet.py: 149 passed, 2 skipped, 1 failed. The failure isTestKeptOnDoubt::test_a_link_at_a_thread_path_is_no_record, withOSError: [WinError 1314]: this host may not create symlinks. That test is untouched. black, isort, flake8 and the comment-history gate are clean.Manual verification
N/A — unit coverage sufficient: this is a test-only change, and the test runs the real lock-contention path.
Related Issues
Fixes #23363
Sibling sweep
Swept: git grep -n "threading.Timer(" -- test/test_crewmate_prune_migration.py
Sibling: test/test_crewmate_prune_migration.py:1573 -- not affected -- keeps the default 120 s wait and asserts lock_waits == 0, so its 0.2 s Timer only ends the hold and counts nothing against the clock
Pattern harvest
Not generalizable: the shape "count expirations of a short timeout inside a fixed wall-clock window" is already a named flake class in testing-conventions.md, and this was one instance of it.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
🤖 Generated with Claude Code