mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:20:43 +00:00
perf(test): shorten qa channel readiness polling
This commit is contained in:
@@ -57,6 +57,7 @@ describe("qa channel transport", () => {
|
||||
await transport.waitReady({
|
||||
gateway: { call },
|
||||
timeoutMs: 2_000,
|
||||
pollIntervalMs: 1,
|
||||
});
|
||||
|
||||
expect(call).toHaveBeenCalledTimes(2);
|
||||
|
||||
@@ -18,6 +18,7 @@ export const QA_CHANNEL_DEFAULT_SUITE_CONCURRENCY = 4;
|
||||
async function waitForQaChannelReady(params: {
|
||||
gateway: QaTransportGatewayClient;
|
||||
timeoutMs?: number;
|
||||
pollIntervalMs?: number;
|
||||
}) {
|
||||
await waitForQaTransportCondition(
|
||||
async () => {
|
||||
@@ -45,7 +46,7 @@ async function waitForQaChannelReady(params: {
|
||||
}
|
||||
},
|
||||
params.timeoutMs ?? 45_000,
|
||||
500,
|
||||
params.pollIntervalMs ?? 500,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ export type QaTransportCommonCapabilities = {
|
||||
waitForReady: (params: {
|
||||
gateway: QaTransportGatewayClient;
|
||||
timeoutMs?: number;
|
||||
pollIntervalMs?: number;
|
||||
}) => Promise<void>;
|
||||
waitForCondition: <T>(
|
||||
check: () => T | Promise<T | null | undefined> | null | undefined,
|
||||
@@ -151,7 +152,11 @@ export type QaTransportAdapter = {
|
||||
state: QaTransportState;
|
||||
capabilities: QaTransportCommonCapabilities;
|
||||
createGatewayConfig: (params: { baseUrl: string }) => QaTransportGatewayConfig;
|
||||
waitReady: (params: { gateway: QaTransportGatewayClient; timeoutMs?: number }) => Promise<void>;
|
||||
waitReady: (params: {
|
||||
gateway: QaTransportGatewayClient;
|
||||
timeoutMs?: number;
|
||||
pollIntervalMs?: number;
|
||||
}) => Promise<void>;
|
||||
buildAgentDelivery: (params: { target: string }) => {
|
||||
channel: string;
|
||||
replyChannel: string;
|
||||
@@ -208,6 +213,7 @@ export abstract class QaStateBackedTransportAdapter implements QaTransportAdapte
|
||||
abstract waitReady: (params: {
|
||||
gateway: QaTransportGatewayClient;
|
||||
timeoutMs?: number;
|
||||
pollIntervalMs?: number;
|
||||
}) => Promise<void>;
|
||||
abstract buildAgentDelivery: (params: { target: string }) => {
|
||||
channel: string;
|
||||
|
||||
Reference in New Issue
Block a user