Repository navigation
test(ci): check stale-lock auto-recovery by retry count, not wall clock - #4986
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Verify acquisition without retry sleeps ci/tests/test_stale_lock_recovery.py |
The test patches the lock sleep function and asserts that acquisition succeeds without retry sleeps. It retains the timeout failure check. |
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related issues
Suggested labels: area: ci
Merge Risk: 
Minimal · up to 0fcf2
-
The test retains stale-lock recovery checks while removing sensitivity to SQLite latency. No actionable merge-blocking issue remains.
Pre-merge checks: 
5
-
Full details: Linked Issues check
-
Explanation
Issue
#4984identifies the flaky 2-second wall-clock assertion intest_auto_recovery_on_timeout. The PR removes that timing assertion and patchesci.util.file_lock_rw.time.sleep. The test now asserts that stale-lock recovery completes without retry sleeps. This checks immediate stale-lock recovery without a load-dependent timing bound.
Full details: Out of Scope Changes check
-
Explanation
The diff changes only
ci/tests/test_stale_lock_recovery.py. The import, mock, and assertion changes directly support the#4984flaky-test fix. No unrelated production code or unrelated behavior changes are present.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Closes #4984
test_auto_recovery_on_timeoutchecked a 2 s wall-clock bound. Under a loaded./testrun, SQLite latency alone took 1.75 to 5.47 s, so the test failed. Run alone it takes about 0.07 s.The test now patches
time.sleepinci.util.file_lock_rwand requires zero retry sleeps. A correct auto-break returns right after breaking the stale lock, so this checks the same thing without depending on timing.Evidence:
pytest ci/tests/test_stale_lock_recovery.py: 4 passed.LockDatabase.is_lock_stalepatched to return False, the test fails as expected.bash lintpasses.Summary by CodeRabbit