mirror of https://github.com/openclaw/openclaw.git
test: dedupe feishu startup preflight waits
This commit is contained in:
parent
5af8322ff5
commit
1ea5bba848
|
|
@ -52,6 +52,12 @@ function buildMultiAccountWebsocketConfig(accountIds: string[]): ClawdbotConfig
|
|||
} as ClawdbotConfig;
|
||||
}
|
||||
|
||||
async function waitForStartedAccount(started: string[], accountId: string) {
|
||||
for (let i = 0; i < 10 && !started.includes(accountId); i += 1) {
|
||||
await Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
stopFeishuMonitor();
|
||||
});
|
||||
|
|
@ -116,10 +122,7 @@ describe("Feishu monitor startup preflight", () => {
|
|||
});
|
||||
|
||||
try {
|
||||
for (let i = 0; i < 10 && !started.includes("beta"); i += 1) {
|
||||
await Promise.resolve();
|
||||
}
|
||||
|
||||
await waitForStartedAccount(started, "beta");
|
||||
expect(started).toEqual(["alpha", "beta"]);
|
||||
expect(started.filter((accountId) => accountId === "alpha")).toHaveLength(1);
|
||||
} finally {
|
||||
|
|
@ -153,10 +156,7 @@ describe("Feishu monitor startup preflight", () => {
|
|||
});
|
||||
|
||||
try {
|
||||
for (let i = 0; i < 10 && !started.includes("beta"); i += 1) {
|
||||
await Promise.resolve();
|
||||
}
|
||||
|
||||
await waitForStartedAccount(started, "beta");
|
||||
expect(started).toEqual(["alpha", "beta"]);
|
||||
expect(runtime.error).toHaveBeenCalledWith(
|
||||
expect.stringContaining("bot info probe timed out"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue