test: parallelize docker aggregate

This commit is contained in:
Peter Steinberger
2026-04-23 14:29:34 +01:00
parent d3dc890821
commit e98331b0be
15 changed files with 382 additions and 75 deletions

View File

@@ -41,8 +41,9 @@ export type McpClientHandle = {
rawMessages: unknown[];
};
const GATEWAY_WS_TIMEOUT_MS = 30_000;
const GATEWAY_CONNECT_RETRY_WINDOW_MS = 45_000;
const GATEWAY_WS_OPEN_TIMEOUT_MS = 5_000;
const GATEWAY_RPC_TIMEOUT_MS = 30_000;
const GATEWAY_CONNECT_RETRY_WINDOW_MS = 120_000;
export function assert(condition: unknown, message: string): asserts condition {
if (!condition) {
@@ -119,7 +120,7 @@ async function connectGatewayOnce(params: {
await new Promise<void>((resolve, reject) => {
const timeout = setTimeout(
() => reject(new Error("gateway ws open timeout")),
GATEWAY_WS_TIMEOUT_MS,
GATEWAY_WS_OPEN_TIMEOUT_MS,
);
timeout.unref?.();
ws.once("open", () => {
@@ -228,7 +229,7 @@ async function connectGatewayOnce(params: {
const timeout = setTimeout(() => {
pending.delete(connectId);
reject(new Error("gateway connect timeout"));
}, GATEWAY_WS_TIMEOUT_MS);
}, GATEWAY_RPC_TIMEOUT_MS);
timeout.unref?.();
pending.set(connectId, {
resolve: () => {
@@ -247,7 +248,7 @@ async function connectGatewayOnce(params: {
const timeout = setTimeout(() => {
pending.delete(id);
reject(new Error("gateway sessions.subscribe timeout"));
}, GATEWAY_WS_TIMEOUT_MS);
}, GATEWAY_RPC_TIMEOUT_MS);
timeout.unref?.();
pending.set(id, {
resolve: () => {

View File

@@ -346,6 +346,7 @@ for _ in $(seq 1 360); do
if node "$entry" gateway health \
--url "ws://127.0.0.1:$PORT" \
--token "$TOKEN" \
--timeout 30000 \
--json >/dev/null 2>&1; then
break
fi
@@ -354,6 +355,7 @@ done
node "$entry" gateway health \
--url "ws://127.0.0.1:$PORT" \
--token "$TOKEN" \
--timeout 30000 \
--json >/dev/null
cat >/tmp/openclaw-openai-web-search-minimal-client.mjs <<'NODE'

View File

@@ -15,11 +15,16 @@ if [[ "${OPENCLAW_QR_SMOKE_FORCE_INSTALL:-0}" == "1" ]]; then
fi
echo "Building Docker image..."
run_logged qr-import-build docker build \
"${DOCKER_BUILD_ARGS[@]}" \
-t "$IMAGE_NAME" \
-f "$ROOT_DIR/scripts/e2e/Dockerfile.qr-import" \
DOCKER_BUILD_CMD=(docker build)
if ((${#DOCKER_BUILD_ARGS[@]} > 0)); then
DOCKER_BUILD_CMD+=("${DOCKER_BUILD_ARGS[@]}")
fi
DOCKER_BUILD_CMD+=(
-t "$IMAGE_NAME"
-f "$ROOT_DIR/scripts/e2e/Dockerfile.qr-import"
"$ROOT_DIR"
)
run_logged qr-import-build "${DOCKER_BUILD_CMD[@]}"
echo "Running qrcode-terminal import smoke..."
run_logged qr-import-run docker run --rm -t "$IMAGE_NAME" node -e "import('qrcode-terminal').then((m)=>m.default.generate('qr-smoke',{small:true}))"