Skip to content

Commit b52df4b

Browse files
cursoragentLowpower
andcommitted
test(daemon): give the ENOSPC host bootstrap more than 30s under MSan
The #1828 fast-fail test forks a real daemon host and waits for the injected publication ENOSPC. Production MCP clients use a 30s startup budget, but under MSan the child still has to finish claim, mem_init, and host_state_prepare before listen. That path can exceed 30s, so the client reports "active or starting" and the suite fails even though the help-text change never touched this code. Keep proving fast-fail by the recorded ENOSPC cause and a single spawn, not by wall-clock. Widen only this test's wait. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Lowpower <Lowpower@users.noreply.github.com>
1 parent b74c035 commit b52df4b

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

‎tests/test_daemon_bootstrap.c‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,16 @@ TEST(daemon_bootstrap_darwin_launch_failure_is_synchronous) {
887887
#endif
888888

889889
#ifndef _WIN32
890-
enum { BOOTSTRAP_ENOSPC_MAX_CHILDREN = 16, BOOTSTRAP_ENOSPC_LOG_CAP = 65536 };
890+
enum {
891+
BOOTSTRAP_ENOSPC_MAX_CHILDREN = 16,
892+
BOOTSTRAP_ENOSPC_LOG_CAP = 65536,
893+
/* Production MCP clients wait 30s. A real forked host under MSan still has
894+
* to finish claim, mem_init, host_state_prepare, then listen before the
895+
* injected ENOSPC can fire; that path can exceed 30s, so this budget is
896+
* how long the client may wait, not the proof. Fast-fail is proven by
897+
* the recorded cause. */
898+
BOOTSTRAP_ENOSPC_STARTUP_TIMEOUT_MS = 120000,
899+
};
891900

892901
typedef struct {
893902
char parent[BOOTSTRAP_TEST_PATH_CAP];
@@ -1068,7 +1077,7 @@ TEST(daemon_bootstrap_fails_fast_when_daemon_dies_at_publication) {
10681077
.identity = &host.identity,
10691078
.executable_path = "/enospc-host-test",
10701079
.connect_timeout_ms = 200,
1071-
.startup_timeout_ms = 30000,
1080+
.startup_timeout_ms = BOOTSTRAP_ENOSPC_STARTUP_TIMEOUT_MS,
10721081
};
10731082
cbm_daemon_bootstrap_result_t result;
10741083
memset(&result, 0, sizeof(result));
@@ -1119,9 +1128,9 @@ TEST(daemon_bootstrap_fails_fast_when_daemon_dies_at_publication) {
11191128
* surfaced verbatim ("failed to start" + errno + path) and the slow
11201129
* "active or starting" timeout wording is absent -- that message is emitted
11211130
* ONLY on the fast-fail break (cbm_daemon_bootstrap_start_failure_format),
1122-
* never on the 30 s deadline path -- and the client stopped after exactly
1131+
* never on the startup-deadline path -- and the client stopped after exactly
11231132
* one spawn instead of respawning a doomed daemon until the deadline. Any
1124-
* regression to the pre-#1828 30 s hang trips these deterministically. */
1133+
* regression to the pre-#1828 hang trips these deterministically. */
11251134
ASSERT_FALSE(stale_wording);
11261135
ASSERT_TRUE(message_names_failure);
11271136
ASSERT_TRUE(message_names_errno);

0 commit comments

Comments
 (0)