test(timeline): synchronize second thread start before lock-wait sleep #47
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/47"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ReTerryDavis/ReVIctory. Originally posted by Geekmemz on 2026-12-04T16:11:56Z.
Summary
Fixes the intermittent failure in
timeline::report::tests::real_waits_are_recorded_with_who_ended_themobserved inDefault testsonmain(e.g., CI run47363682552, panicking atcrates/victory-gpu/src/timeline/report.rs:943:36).Previously, the test acquired
lock, spawnedsecond, slept 20 ms, and immediately droppedheld. Under parallel test load,secondthread startup can take longer than 20 ms, allowingsecondto acquirelockuncontended afterheldis already dropped—leavingtrace.waitswithout an entry forsecondand panicking ontrace.waits[&second].Changes
secondthread startup with anAtomicBoolbefore starting the hold window (using an atomic spin/yield rather thanMutex/Condvarbecausehooks::wrap_own()is active and would record extra lock/condvar wait events).lockfor 30 ms aftersecondsignals readiness before droppingheld.trace.waits[&second]indexing with.get(&second).into_iter().flatten()so any unexpected failure surfaces cleanly through theassert_eq!(contended.map(|c| c.0), Some(me))assertion.Verification
Ran locally on Windows 11 (
x86_64-pc-windows-msvc, Rust1.98.1):cargo clippy -p victory-gpu --all-targets --locked -- -D warnings— passed (0 warnings)cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings— passed (0 warnings)cargo test -p victory-gpu --lib --all-features --locked timeline::report -- --nocapture(5 consecutive runs) — 3 passed, 0 failed on all 5 runscargo test -p xtask --locked— 9 passed, 0 failed (asset policy: 407 files ok)View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.