mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
test(ci): stabilize plugin prerelease async waits (#117684)
* test(voice-call): await replaced bridge cleanup * test(mistral): await runaway transcript error
This commit is contained in:
@@ -378,7 +378,11 @@ describe("buildMistralRealtimeTranscriptionProvider", () => {
|
||||
{ type: "transcription.segment", text: "late segment", start: 0, end: 1 },
|
||||
{ type: "transcription.done", text: "late done" },
|
||||
]);
|
||||
const onError = vi.fn();
|
||||
let resolveError: (() => void) | undefined;
|
||||
const errorReceived = new Promise<void>((resolve) => {
|
||||
resolveError = resolve;
|
||||
});
|
||||
const onError = vi.fn(() => resolveError?.());
|
||||
const onTranscript = vi.fn();
|
||||
let lastPartialLength = 0;
|
||||
let partialCalls = 0;
|
||||
@@ -393,6 +397,7 @@ describe("buildMistralRealtimeTranscriptionProvider", () => {
|
||||
});
|
||||
|
||||
await session.connect();
|
||||
await errorReceived;
|
||||
await vi.waitFor(() => {
|
||||
expect(onError).toHaveBeenCalledExactlyOnceWith(
|
||||
expect.objectContaining({
|
||||
|
||||
@@ -1944,7 +1944,9 @@ describe("RealtimeCallHandler path routing", () => {
|
||||
const oldClosed = waitForClose(oldWs);
|
||||
callbacks[0]?.onClose?.("error");
|
||||
await oldClosed;
|
||||
expect(oldCloseBridge).toHaveBeenCalledOnce();
|
||||
await waitForRealtimeTest(() => {
|
||||
expect(oldCloseBridge).toHaveBeenCalledOnce();
|
||||
});
|
||||
expect(replacementCloseBridge).not.toHaveBeenCalled();
|
||||
expect(hangupCall).not.toHaveBeenCalled();
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user