test(vision-manager): extract refresh_running_after_mem_check; assert log distinguishes fix from bug (0.87.18)

Two 0.87.15 ship-blockers:

1. mem_check_and_stop test now ALSO greps for the "deferring to next
   tick" warning — distinguishes fix from bug. Mutation-confirmed.

2. Extract `refresh_running_after_mem_check` (sets global instead of
   echoing so loop-scope flags persist across calls) and drive it
   directly from the harness, closing the structurally-untestable
   post-mem refresh ERR guard.

Adjacent: log-on-flip gating on both ERR warnings; `log` to stderr;
dangling-TempDir in app::tests reclaim test fixed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-06-23 20:17:47 +02:00
parent e3d16e49b7
commit d6a4fd668c
6 changed files with 177 additions and 27 deletions

View File

@@ -1425,9 +1425,15 @@ mod tests {
.await
.unwrap();
let storage: Arc<dyn Storage> = Arc::new(LocalStorage::new(
tempfile::tempdir().unwrap().path(),
));
// Bind to a local so the TempDir lives for the rest of the test.
// `tempfile::tempdir().unwrap().path()` would drop the TempDir
// at end-of-expression and `LocalStorage` would hold a path to
// a deleted directory. (Today this is fine because the dispatch
// fails before storage is touched, but it makes the test fragile
// to any future code rearrangement.)
let storage_dir = tempfile::tempdir().unwrap();
let storage: Arc<dyn Storage> =
Arc::new(LocalStorage::new(storage_dir.path()));
let mut cfg = crate::config::AnalysisConfig::default();
cfg.workers = 1;
cfg.job_timeout = Duration::from_secs(1);