test: the desktop-PATH agent probe waits long enough on a loaded machine (#6072)
desktop_path_can_start_an_agent_and_its_runtime gave the version probe 3 s and the first reply 5 s. Under a full test run on a loaded macOS machine the probe came back empty (version None, twice in a row), while the test alone passes in 0.4 s. Both limits are now 20 s; a working agent still answers at once, so the test takes no longer. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -489,11 +489,13 @@ mod tests {
|
||||
if let Some(root) = std::env::var_os(CHILD) {
|
||||
let root = PathBuf::from(root);
|
||||
let agent = find_in("solidcraft-test-agent", &search_dirs()).unwrap();
|
||||
assert_eq!(version(&agent, Duration::from_secs(3)).as_deref(), Some("1.2.3"));
|
||||
// Generous limits: both answer at once, but a whole test run on a loaded machine
|
||||
// can keep `env`, the shell and the script from starting within 3 s.
|
||||
assert_eq!(version(&agent, Duration::from_secs(20)).as_deref(), Some("1.2.3"));
|
||||
let mut p = AgentProcess::spawn(&[agent.to_string_lossy().into_owned()], &root, &[], || {}).unwrap();
|
||||
let message = serde_json::json!({"id": 1, "method": "initialize"});
|
||||
p.send(&message);
|
||||
let reply = p.from_agent.recv_timeout(Duration::from_secs(5)).unwrap();
|
||||
let reply = p.from_agent.recv_timeout(Duration::from_secs(20)).unwrap();
|
||||
p.shutdown(true);
|
||||
match reply {
|
||||
FromAgent::Line(line) => assert_eq!(serde_json::from_str::<serde_json::Value>(&line).unwrap(), message),
|
||||
|
||||
Reference in New Issue
Block a user