perf(test): shorten qa channel readiness polling

This commit is contained in:
Peter Steinberger
2026-04-20 16:00:26 +01:00
parent 0b239d163a
commit 09171eee8d
3 changed files with 10 additions and 2 deletions

View File

@@ -57,6 +57,7 @@ describe("qa channel transport", () => {
await transport.waitReady({
gateway: { call },
timeoutMs: 2_000,
pollIntervalMs: 1,
});
expect(call).toHaveBeenCalledTimes(2);

View File

@@ -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,
);
}

View File

@@ -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;