feat(tui): add 16 race condition reliability tests (bd-3fjk)

- 4 stale response tests: issue list, dashboard, MR list, cross-screen isolation
- 4 SQLITE_BUSY error handling tests: toast display, nav preservation, idempotent toasts, error-then-success
- 7 cancel race tests: cancel/resubmit, rapid 5-submit sequence, key isolation, complete removes handle, stale completion no-op, stuck loading prevention, cancel_all
- 1 issue detail stale guard test
- Added active_cancel_token() method to TaskSupervisor for test observability
This commit is contained in:
teernisse
2026-02-19 00:52:58 -05:00
parent 9bcc512639
commit 656db00c04
2 changed files with 676 additions and 0 deletions

View File

@@ -232,6 +232,14 @@ impl TaskSupervisor {
}
}
/// Get the cancel token for an active task, if any.
///
/// Used in tests to verify cooperative cancellation behavior.
#[must_use]
pub fn active_cancel_token(&self, key: &TaskKey) -> Option<Arc<CancelToken>> {
self.active.get(key).map(|h| h.cancel.clone())
}
/// Number of currently active tasks.
#[must_use]
pub fn active_count(&self) -> usize {