Repository navigation
test(thumbreq): build the harness pool without a worker - #268
Conversation
a_symlink_row_keys_the_cache_on_its_target_mtime read its job back through cancel_all, but the harness pool's one worker could pop it first, which failed 2 of 5 runs. With Pool::idle the queue is exact, so every test in the file now asserts what reached it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe test pool now supports an idle, worker-free setup. Thumbnail request tests use it to inspect queued jobs, checking that cache hits and selected misses queue no jobs and that ordinary misses queue the expected file path. ChangesThumbnail request test harness
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to The reported queue-inspection race is not present in this change; it appears mergeable subject to normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 64.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 2 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
the thumbnail stall is not fixed in 0.3.10; this PR changes only the thumbnail test harness (137b438, v0.3.10), so this stays open. Thanks @mrphonk! https://github.com/thisisgm/flea/releases/tag/v0.3.10 |
|
Busy thumbnail workers could lose visible requests; the separate production fix at cd27b96ab3 retries them in v0.3.11, following your test-harness fix already merged in v0.3.10. Thanks @mrphonk! Release. |
backend::thumbreq::tests::a_symlink_row_keys_the_cache_on_its_target_mtimefails intermittently withone job queued(left 0, right 1). The test reads its job back throughpool.cancel_all(), but the harness built a real one-workerPool, and that worker sometimes popped the job first. It failed 2 of 5 runs here.The harness now uses
Pool::idle(), a test-only constructor for a queue no worker drains, so what a test queued is exactly what it reads back. No test inthumbreq.rsneeds a worker. They all check the request policy. Since the queue is now exact, the other tests assert it too: the four that queue nothing require an empty queue, and the two that queue a row require exactly one job forphoto.jpg.TestPool::newinthumbs.rsbuilds onPool::idle()instead of a third copy of the queue constructor. Production code is unchanged.src/backend/thumbs.rswas already over the hard cap, so its recorded ceiling moves from 460 to 466, andthumbreq.rsdrops from 418 to 417, with the note in AGENTS.md "File budget".Validation: the test passed 50 of 50 runs after the change.
cargo test --lockedpassed (1583 passed, 0 failed), andtools/flea-clippyandtools/flea-file-budgetboth pass. As a mutation check, queueing the wrong path inqueue_rowmakes the two strengthened tests fail; before this change they passed. The headless battery (tests/run-all.sh) was not run for this PR, since the change touches only Rust test code.Summary by CodeRabbit