mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
perf(test): simplify shutdown rejection tick wait
This commit is contained in:
@@ -30,13 +30,7 @@ describe("monitorIMessageProvider", () => {
|
||||
});
|
||||
abortController.abort();
|
||||
// Give the event loop a turn to surface any unhandledRejection, if present.
|
||||
await new Promise<void>((resolve) => {
|
||||
if (typeof setImmediate === "function") {
|
||||
setImmediate(resolve);
|
||||
return;
|
||||
}
|
||||
setTimeout(resolve, 0);
|
||||
});
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
detach();
|
||||
} finally {
|
||||
process.off("unhandledRejection", onUnhandled);
|
||||
|
||||
Reference in New Issue
Block a user