test: harden cron MCP Docker smoke

This commit is contained in:
Peter Steinberger
2026-04-26 11:33:22 +01:00
parent cd79e01be3
commit c74fb78194
3 changed files with 26 additions and 19 deletions

View File

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

View File

@@ -26,7 +26,8 @@ docker run --rm \
-e "OPENCLAW_SKIP_CHANNELS=1" \
-e "OPENCLAW_SKIP_GMAIL_WATCHER=1" \
-e "OPENCLAW_SKIP_CANVAS_HOST=1" \
-e "OPENCLAW_ACPX_RUNTIME_STARTUP_PROBE=1" \
-e "OPENCLAW_SKIP_ACPX_RUNTIME=1" \
-e "OPENCLAW_SKIP_ACPX_RUNTIME_PROBE=1" \
-e "OPENCLAW_STATE_DIR=/tmp/openclaw-state" \
-e "OPENCLAW_CONFIG_PATH=/tmp/openclaw-state/openclaw.json" \
-e "GW_URL=ws://127.0.0.1:$PORT" \
@@ -45,11 +46,22 @@ docker run --rm \
node --import tsx scripts/e2e/cron-mcp-cleanup-seed.ts >/tmp/cron-mcp-cleanup-seed.log
node \"\$entry\" gateway --port $PORT --bind loopback --allow-unconfigured >/tmp/cron-mcp-cleanup-gateway.log 2>&1 &
gateway_pid=\$!
stop_process() {
pid=\"\$1\"
kill \"\$pid\" >/dev/null 2>&1 || true
for _ in \$(seq 1 40); do
if ! kill -0 \"\$pid\" >/dev/null 2>&1; then
wait \"\$pid\" >/dev/null 2>&1 || true
return
fi
sleep 0.25
done
kill -9 \"\$pid\" >/dev/null 2>&1 || true
wait \"\$pid\" >/dev/null 2>&1 || true
}
cleanup_inner() {
kill \"\$mock_pid\" >/dev/null 2>&1 || true
kill \"\$gateway_pid\" >/dev/null 2>&1 || true
wait \"\$mock_pid\" >/dev/null 2>&1 || true
wait \"\$gateway_pid\" >/dev/null 2>&1 || true
stop_process \"\$mock_pid\"
stop_process \"\$gateway_pid\"
}
dump_gateway_log_on_error() {
status=\$?
@@ -84,19 +96,6 @@ docker run --rm \
tail -n 120 /tmp/cron-mcp-cleanup-gateway.log 2>/dev/null || true
exit 1
fi
acpx_ready=0
for _ in \$(seq 1 2400); do
if grep -q '\[plugins\] embedded acpx runtime backend ready' /tmp/cron-mcp-cleanup-gateway.log 2>/dev/null; then
acpx_ready=1
break
fi
sleep 0.25
done
if [ \"\$acpx_ready\" -ne 1 ]; then
echo \"Embedded ACPX runtime did not become ready\"
tail -n 120 /tmp/cron-mcp-cleanup-gateway.log 2>/dev/null || true
exit 1
fi
node --import tsx scripts/e2e/cron-mcp-cleanup-docker-client.ts
" >"$CLIENT_LOG" 2>&1
status=${PIPESTATUS[0]}

View File

@@ -80,6 +80,9 @@ async function main() {
},
agents: {
defaults: {
heartbeat: {
every: "0m",
},
skipBootstrap: true,
contextInjection: "never",
skills: [],
@@ -90,12 +93,16 @@ async function main() {
},
tools: {
profile: "coding",
alsoAllow: ["bundle-mcp"],
subagents: {
tools: {
alsoAllow: ["bundle-mcp"],
},
},
},
plugins: {
enabled: false,
},
mcp: {
servers: {
cronCleanupProbe: {