fix(maestro): assert on the git shim log, not a wall-clock budget
a_session_without_a_worktree_costs_no_probe waited up to 5s for the watcher pass to run, using that wait's timeout panic as an implicit proxy for "no probe happened". Under a loaded full-workspace run the watcher task can be scheduled well past 5s, so the test flaked. Poll the shim log directly for A's probe instead of a derived snapshot state, and use the wait only as a 30s hang guard. The actual property - B was never probed - is asserted unconditionally on the log content, independent of timing. Fixes #173.
This commit is contained in:
@@ -14,7 +14,7 @@ use std::process::Command;
|
||||
use std::time::Duration;
|
||||
|
||||
use common::{init_bare_repo, init_repo, push_all_to_origin, wait_for_async, DaemonFixture};
|
||||
use maestro_protocol::{CreateSessionRequest, InTheWay, WorktreeSpec};
|
||||
use maestro_protocol::{CreateSessionRequest, WorktreeSpec};
|
||||
use tempfile::TempDir;
|
||||
|
||||
fn request(cwd: &std::path::Path, repo: &std::path::Path, branch: &str) -> CreateSessionRequest {
|
||||
@@ -91,13 +91,12 @@ async fn a_session_without_a_worktree_costs_no_probe() {
|
||||
Duration::from_millis(100),
|
||||
);
|
||||
|
||||
// The pass demonstrably runs and probed A's tree...
|
||||
wait_for_async(Duration::from_secs(5), || async {
|
||||
fx.manager
|
||||
.snapshot()
|
||||
.await
|
||||
.iter()
|
||||
.any(|s| s.worktree.is_some() && s.blocked_work == Some(InTheWay::default()))
|
||||
// 30s is a hang guard only, not the property under test — that's the
|
||||
// timing-free `contains` check below.
|
||||
wait_for_async(Duration::from_secs(30), || async {
|
||||
std::fs::read_to_string(&log_path)
|
||||
.map(|calls| calls.contains(repo_a.path().to_str().unwrap()))
|
||||
.unwrap_or(false)
|
||||
})
|
||||
.await;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user