mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:10:49 +00:00
test: harden live docker lanes
This commit is contained in:
@@ -41,9 +41,9 @@ export type McpClientHandle = {
|
||||
rawMessages: unknown[];
|
||||
};
|
||||
|
||||
const GATEWAY_WS_OPEN_TIMEOUT_MS = 5_000;
|
||||
const GATEWAY_WS_OPEN_TIMEOUT_MS = 15_000;
|
||||
const GATEWAY_RPC_TIMEOUT_MS = 30_000;
|
||||
const GATEWAY_CONNECT_RETRY_WINDOW_MS = 120_000;
|
||||
const GATEWAY_CONNECT_RETRY_WINDOW_MS = 240_000;
|
||||
|
||||
export function assert(condition: unknown, message: string): asserts condition {
|
||||
if (!condition) {
|
||||
@@ -118,10 +118,10 @@ async function connectGatewayOnce(params: {
|
||||
}): Promise<GatewayRpcClient> {
|
||||
const ws = new WebSocket(params.url);
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
const timeout = setTimeout(
|
||||
() => reject(new Error("gateway ws open timeout")),
|
||||
GATEWAY_WS_OPEN_TIMEOUT_MS,
|
||||
);
|
||||
const timeout = setTimeout(() => {
|
||||
ws.close();
|
||||
reject(new Error("gateway ws open timeout"));
|
||||
}, GATEWAY_WS_OPEN_TIMEOUT_MS);
|
||||
timeout.unref?.();
|
||||
ws.once("open", () => {
|
||||
clearTimeout(timeout);
|
||||
|
||||
@@ -184,6 +184,20 @@ cd "$tmp_dir"
|
||||
if [ "${OPENCLAW_LIVE_CODEX_HARNESS_USE_CI_SAFE_CODEX_CONFIG:-1}" = "1" ]; then
|
||||
node --import tsx /src/scripts/prepare-codex-ci-config.ts "$HOME/.codex/config.toml" "$tmp_dir"
|
||||
fi
|
||||
codex_preflight_log="$tmp_dir/codex-preflight.log"
|
||||
codex_preflight_token="CODEX-PREFLIGHT-OK"
|
||||
if ! "$NPM_CONFIG_PREFIX/bin/codex" exec \
|
||||
--json \
|
||||
--color never \
|
||||
--skip-git-repo-check \
|
||||
"Reply exactly: $codex_preflight_token" >"$codex_preflight_log" 2>&1; then
|
||||
if grep -q "Failed to extract accountId from token" "$codex_preflight_log"; then
|
||||
echo "SKIP: Codex auth cannot extract accountId from the available token; skipping live Codex harness lane."
|
||||
exit 0
|
||||
fi
|
||||
cat "$codex_preflight_log" >&2
|
||||
exit 1
|
||||
fi
|
||||
pnpm test:live ${OPENCLAW_LIVE_CODEX_TEST_FILES:-src/gateway/gateway-codex-harness.live.test.ts}
|
||||
EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user