Skip to content

Commit c74fb78

Browse files
committed
test: harden cron MCP Docker smoke
1 parent cd79e01 commit c74fb78

3 files changed

Lines changed: 26 additions & 19 deletions

File tree

scripts/e2e/cron-mcp-cleanup-docker-client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function describeProbePid(pid: number): Promise<string | undefined> {
5454

5555
async function waitForProbePid(pidPath: string): Promise<number | undefined> {
5656
const startedAt = Date.now();
57-
while (Date.now() - startedAt < 240_000) {
57+
while (Date.now() - startedAt < 600_000) {
5858
const pid = await readProbePid(pidPath);
5959
if (pid) {
6060
return pid;
@@ -133,6 +133,7 @@ async function runCronCleanupScenario(params: {
133133
message: "Use available context and then stop.",
134134
timeoutSeconds: 90,
135135
lightContext: true,
136+
toolsAllow: ["bundle-mcp"],
136137
},
137138
delivery: { mode: "none" },
138139
});

scripts/e2e/cron-mcp-cleanup-docker.sh

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ docker run --rm \
2626
-e "OPENCLAW_SKIP_CHANNELS=1" \
2727
-e "OPENCLAW_SKIP_GMAIL_WATCHER=1" \
2828
-e "OPENCLAW_SKIP_CANVAS_HOST=1" \
29-
-e "OPENCLAW_ACPX_RUNTIME_STARTUP_PROBE=1" \
29+
-e "OPENCLAW_SKIP_ACPX_RUNTIME=1" \
30+
-e "OPENCLAW_SKIP_ACPX_RUNTIME_PROBE=1" \
3031
-e "OPENCLAW_STATE_DIR=/tmp/openclaw-state" \
3132
-e "OPENCLAW_CONFIG_PATH=/tmp/openclaw-state/openclaw.json" \
3233
-e "GW_URL=ws://127.0.0.1:$PORT" \
@@ -45,11 +46,22 @@ docker run --rm \
4546
node --import tsx scripts/e2e/cron-mcp-cleanup-seed.ts >/tmp/cron-mcp-cleanup-seed.log
4647
node \"\$entry\" gateway --port $PORT --bind loopback --allow-unconfigured >/tmp/cron-mcp-cleanup-gateway.log 2>&1 &
4748
gateway_pid=\$!
49+
stop_process() {
50+
pid=\"\$1\"
51+
kill \"\$pid\" >/dev/null 2>&1 || true
52+
for _ in \$(seq 1 40); do
53+
if ! kill -0 \"\$pid\" >/dev/null 2>&1; then
54+
wait \"\$pid\" >/dev/null 2>&1 || true
55+
return
56+
fi
57+
sleep 0.25
58+
done
59+
kill -9 \"\$pid\" >/dev/null 2>&1 || true
60+
wait \"\$pid\" >/dev/null 2>&1 || true
61+
}
4862
cleanup_inner() {
49-
kill \"\$mock_pid\" >/dev/null 2>&1 || true
50-
kill \"\$gateway_pid\" >/dev/null 2>&1 || true
51-
wait \"\$mock_pid\" >/dev/null 2>&1 || true
52-
wait \"\$gateway_pid\" >/dev/null 2>&1 || true
63+
stop_process \"\$mock_pid\"
64+
stop_process \"\$gateway_pid\"
5365
}
5466
dump_gateway_log_on_error() {
5567
status=\$?
@@ -84,19 +96,6 @@ docker run --rm \
8496
tail -n 120 /tmp/cron-mcp-cleanup-gateway.log 2>/dev/null || true
8597
exit 1
8698
fi
87-
acpx_ready=0
88-
for _ in \$(seq 1 2400); do
89-
if grep -q '\[plugins\] embedded acpx runtime backend ready' /tmp/cron-mcp-cleanup-gateway.log 2>/dev/null; then
90-
acpx_ready=1
91-
break
92-
fi
93-
sleep 0.25
94-
done
95-
if [ \"\$acpx_ready\" -ne 1 ]; then
96-
echo \"Embedded ACPX runtime did not become ready\"
97-
tail -n 120 /tmp/cron-mcp-cleanup-gateway.log 2>/dev/null || true
98-
exit 1
99-
fi
10099
node --import tsx scripts/e2e/cron-mcp-cleanup-docker-client.ts
101100
" >"$CLIENT_LOG" 2>&1
102101
status=${PIPESTATUS[0]}

scripts/e2e/cron-mcp-cleanup-seed.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ async function main() {
8080
},
8181
agents: {
8282
defaults: {
83+
heartbeat: {
84+
every: "0m",
85+
},
8386
skipBootstrap: true,
8487
contextInjection: "never",
8588
skills: [],
@@ -90,12 +93,16 @@ async function main() {
9093
},
9194
tools: {
9295
profile: "coding",
96+
alsoAllow: ["bundle-mcp"],
9397
subagents: {
9498
tools: {
9599
alsoAllow: ["bundle-mcp"],
96100
},
97101
},
98102
},
103+
plugins: {
104+
enabled: false,
105+
},
99106
mcp: {
100107
servers: {
101108
cronCleanupProbe: {

0 commit comments

Comments
 (0)