Skip to content

Commit 6dad92c

Browse files
committed
fix(tests): bump TestDaemon startup timeout from 30s to 60s
The user reported intermittent failures of `daemon_mode_two_engines_share_same_hyperd` on macOS: panicked at hyperdb-mcp/tests/daemon_tests.rs:818: TestDaemon did not start within 30 seconds Root cause: the outer wait was the same length as `HyperProcess::new`'s own internal 30s timeout for the hyperd-callback connection. Under macOS load (parallel tests, hyperd subprocess churn, system resource pressure), hyperd startup can approach or exceed that limit. When it does, the outer assertion fires before the inner timeout can return its actual error message — masking the real cause behind a generic "did not start" panic. Bumping the outer timeout to 60s ensures the inner timeout has room to surface a real error via the existing `daemon_handle.is_finished()` branch. If hyperd genuinely can't start, we'll see "daemon thread errored: <real reason>" instead of the unhelpful generic message. Also tightens the panic message to clarify the failure mode (daemon thread still running, no discovery file written) so the next reader knows whether to look at hyperd-startup vs. discovery-write paths.
1 parent d4c3a06 commit 6dad92c

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎hyperdb-mcp/tests/daemon_tests.rs‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,14 @@ impl TestDaemon {
796796
// Wait for daemon to become ready. CI runners (especially macOS)
797797
// can be significantly slower than local dev — hyperd startup
798798
// alone may take 10+ seconds under load.
799+
//
800+
// The outer timeout MUST exceed `HyperProcess::new`'s own 30s
801+
// wait for the hyperd-callback connection. Otherwise, when
802+
// hyperd is slow to start, the bare "TestDaemon did not start"
803+
// assertion fires before the daemon thread can return its
804+
// actual error — masking the real cause behind a generic
805+
// timeout. 60s gives the inner timeout room to surface via the
806+
// `daemon_handle.is_finished()` branch below.
799807
let start = Instant::now();
800808
loop {
801809
if let Some(info) = discovery::discover() {
@@ -806,7 +814,7 @@ impl TestDaemon {
806814
};
807815
}
808816
// Fail fast if the daemon thread has already exited (bind error,
809-
// spawn error, etc.). Avoids the unhelpful 30s-timeout panic.
817+
// spawn error, etc.). Avoids the unhelpful generic-timeout panic.
810818
if daemon_handle.is_finished() {
811819
let msg = match daemon_handle.join() {
812820
Ok(Ok(())) => "daemon thread exited cleanly without writing discovery".into(),
@@ -816,8 +824,8 @@ impl TestDaemon {
816824
panic!("TestDaemon failed to start: {msg}");
817825
}
818826
assert!(
819-
start.elapsed() <= Duration::from_secs(30),
820-
"TestDaemon did not start within 30 seconds"
827+
start.elapsed() <= Duration::from_secs(60),
828+
"TestDaemon did not start within 60 seconds (daemon thread still running, no discovery file written)"
821829
);
822830
std::thread::sleep(Duration::from_millis(200));
823831
}

0 commit comments

Comments
 (0)