test(harness): pid-only --dir sweep + deadline-poll asserts (test-hygiene) - #449
Conversation
…iene)
Pid-only temp-dir names (`temp_dir().join(format!("...-{}", pid))`) at
eight spawn sites across six suites resurrected STALE data dirs: a
crashed run leaves its dir behind, the pid is eventually reused, and
the next run's server silently reloads the leftover persistence state
(the documented CWD/stale-reload trap) — failures then point at
whatever assertion tripped over the ghost data, not at the cause.
- info_memory_allocator_pagecache, memory_doctor_response,
memory_prometheus_kinds: the shared Moon harness now owns a
tempfile::TempDir (random unique name; removed on drop AFTER the
child is killed — hand-written Drop body runs before field drops).
- vector_exact_rerank (3 sites): RAII tempdir; also removes the
manual pre/post remove_dir_all pairs, so cleanup now happens even
when an assert panics mid-test.
- vector_db_isolation (2 sites): unique random dirs via
tempfile::Builder + keep(). Deliberately NOT RAII: the restart test
shares one dir between two Moon values (kill_keep_dir → same-port
respawn), so the existing PathBuf ownership + manual cleanup are
kept and only the collision-prone NAME is fixed.
- tls_park_keyupdate: RAII tempdir; early-return and end-of-test
manual removes deleted.
parked_idle_parity deadline-poll fixes (the flakes deferred from the
#444/#445 rounds, all environmental classes observed in CI or today's
gate runs):
- CLIENT KILL registry-removal assert now POLLS with a 10s deadline —
the client-side close arrives instantly via shutdown(2) but the
registry entry is released only when the killed handler task gets
scheduled; the read-once assert fired 3/3 on the starved 2-vCPU
runner and passed solo (documented assert-too-soon race).
- All 13 TcpStream::connect sites use a connect_retry helper (10s
deadline, 50ms backoff): under full-suite load a freshly listening
server can still refuse the first attempts, which failed tests at
the connect line (seen live today at the F6 test's connect).
- Read deadlines 10s → 30s in the two reply helpers; deadline-bound,
so green runs spend no extra time.
The client_tracking_invalidation multikey second-key push flake is
PRODUCT-side (a real RESP3 client would miss the same invalidation) —
filed as #448 with the merge-base A/B evidence instead of being
papered over here.
Gates: fmt + clippy -D warnings (default and tokio,jemalloc); all six
converted suites + parked_idle_parity green on macOS monoio (31
tests); tokio leg green on the four suites that run there. Bench
gates waived — tests-only change, no src/ code touched.
Refs #444 #445 #446, closes nothing (#448 filed for the product flake)
author: Tin Dang
|
Warning Review limit reached
Next review available in: 25 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
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 |
PR Summary by QodoTest harness: replace pid-only temp dirs + add deadline-based polling/retries
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1.
|
The queued test-hygiene sweep from the #438 campaign tail (after #444/#445/#446).
Pid-only temp dirs (8 sites, 6 suites)
temp_dir().join(format!("...-{}", pid))resurrects a crashed run's leftover dir once the pid is reused — the server then reloads stale persistence state and the suite fails on ghost data (the documented stale-reload trap). Converted totempfile:Moonharness owns aTempDir(removed on drop, after the child kill in the hand-writtenDropbody).remove_dir_allpairs deleted, so cleanup now also happens when an assert panics.Builder+keep(); deliberately not RAII because the restart test shares one dir between two server handles (kill_keep_dir→ same-port respawn), so only the collision-prone name changes.parked_idle_parity deadline-polls
The flaky asserts deferred from the #444 round, all environmental:
shutdown(2)), registry release needs the killed handler task scheduled; the read-once assert failed 3/3 on the starved 2-vCPU runner and passed solo.connect_retryhelper (10s deadline / 50ms backoff) — a freshly listening server can refuse first attempts under full-suite load (seen live at the F6 test's connect line during the fix(server): accept-loop HOL block, migration fd ownership, park auth gates (#438 F3–F6 + conn-secondary) #446 gates).Not fixed here, filed instead
client_tracking_invalidation's missing second-key invalidation push is product-side (a real RESP3 tracking client would miss the same push) → #448, with the merge-base A/B evidence from the #446 gates.Gates
fmt + clippy
-D warnings(both feature sets); all six converted suites + parked_idle_parity green on macOS monoio (31 tests); tokio leg green on the four suites that run there. Tests-only change — nosrc/code touched, bench gates waived.