fix(cli): race condition in thread rm + flaky test #266
Reference in New Issue
Block a user
Delete Branch "fix/265-flaky-thread-rm"
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?
What
Fix flaky
cli thread commands > run / threads / thread / thread rmtest.Root Cause
cmdThreadRemoverace: thread moves from active to history between resolve and deleteFix
rm.ts: always call both removeThreadEntry and removeThreadHistoryEntries5x consecutive runs: 0 failures. Full suite: 104 pass.
Closes #265
LGTM ✅ TOCTOU 竞态用双删消除,比加锁简洁且安全。测试加 wait 也合理。