Files
codewhale/crates
Hunter Bown c2d13c21bf test: stabilize parallel test execution + bump task_manager timeouts
Fixes a cluster of intermittent failures observed on macOS under
parallel test load. Root causes were tests mutating shared global
state (HOME, USERPROFILE, DEEPSEEK_CONFIG_PATH env vars and
~/.deepseek/ filesystem) without holding the process-wide test
lock, plus a few outdated-by-PR assertions and a tight 3s timeout
on Windows CI.

Changes:

* Three EnvGuard / HomeGuard types (commands/config.rs,
  commands/network.rs, tools/recall_archive.rs) now acquire
  crate::test_support::lock_test_env() and hold the MutexGuard
  for their full lifetime, replacing local mutexes that
  serialized only within a module. Call sites that previously
  acquired lock_test_env() explicitly with `let _lock = ...`
  before constructing the guard drop that redundant acquisition;
  std::sync::Mutex is not reentrant and double-locking on the
  same thread would deadlock.
* settings.rs::config_path_test_guard() now returns the global
  test_env lock instead of an isolated module-local mutex.
* model_picker.rs create_test_app() now returns (App, MutexGuard)
  so picker tests hold the same lock — eliminates env-var races
  with config-mutating tests in adjacent modules.
* task_manager.rs: 4 tests using wait_for_terminal_state bump
  3s -> 10s to give Windows CI file-I/O headroom (we saw one
  intermittent timeout on the v0.8.27 PR Windows job).
* config.rs: 2 api-key tests now set DEEPSEEK_SECRET_BACKEND=local
  so they exercise file-backed storage in CI rather than fail on
  Keychain access.
* history.rs: removes streaming_thinking_live_collapses_unless_verbose
  which asserted the OLD behavior PR #1390 (#861 RC4) intentionally
  changed. The new contract is covered by the three tests PR #1390
  added.
* .claude/HANDOFF_v0.8.28_user_issues.md: notes #1394 / PR #1393
  as a deferred prompt-reliability enhancement.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 17:33:57 -05:00
..