mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:20:43 +00:00
perf: remove Matrix auth retry waits in tests
This commit is contained in:
@@ -780,6 +780,7 @@ describe("resolveMatrixAuth", () => {
|
||||
setMatrixAuthClientDepsForTest({
|
||||
MatrixClient: MockMatrixClient as unknown as typeof import("./sdk.js").MatrixClient,
|
||||
ensureMatrixSdkLoggingConfigured: ensureMatrixSdkLoggingConfiguredMock,
|
||||
retryMinDelayMs: 0,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import type { MatrixAuth, MatrixResolvedConfig } from "./types.js";
|
||||
type MatrixAuthClientDeps = {
|
||||
MatrixClient: typeof import("../sdk.js").MatrixClient;
|
||||
ensureMatrixSdkLoggingConfigured: typeof import("./logging.js").ensureMatrixSdkLoggingConfigured;
|
||||
retryMinDelayMs?: number;
|
||||
};
|
||||
|
||||
type MatrixCredentialsReadDeps = {
|
||||
@@ -58,6 +59,7 @@ const MATRIX_AUTH_REQUEST_RETRY_RE =
|
||||
export function setMatrixAuthClientDepsForTest(deps?: {
|
||||
MatrixClient: typeof import("../sdk.js").MatrixClient;
|
||||
ensureMatrixSdkLoggingConfigured: typeof import("./logging.js").ensureMatrixSdkLoggingConfigured;
|
||||
retryMinDelayMs?: number;
|
||||
}): void {
|
||||
matrixAuthClientDepsForTest = deps;
|
||||
}
|
||||
@@ -117,7 +119,7 @@ function credentialsMatchBackfillAuthLineage(params: {
|
||||
async function retryMatrixAuthRequest<T>(label: string, run: () => Promise<T>): Promise<T> {
|
||||
return await retryAsync(run, {
|
||||
attempts: 3,
|
||||
minDelayMs: 250,
|
||||
minDelayMs: matrixAuthClientDepsForTest?.retryMinDelayMs ?? 250,
|
||||
maxDelayMs: 1_500,
|
||||
jitter: 0.1,
|
||||
label,
|
||||
|
||||
Reference in New Issue
Block a user