mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
test(telegram): speed webhook shutdown retry proof (#109271)
This commit is contained in:
@@ -238,6 +238,7 @@ beforeEach(async () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
vi.useRealTimers();
|
||||
clearTelegramRuntime();
|
||||
closeOpenClawStateDatabaseForTest();
|
||||
const stateDir = webhookStateDir;
|
||||
@@ -1216,6 +1217,7 @@ describe("startTelegramWebhook", () => {
|
||||
});
|
||||
|
||||
it("stops claimed completion retries when the webhook stops", async () => {
|
||||
vi.useFakeTimers();
|
||||
let completeAttempts = 0;
|
||||
setTelegramRuntime({
|
||||
state: {
|
||||
@@ -1253,7 +1255,7 @@ describe("startTelegramWebhook", () => {
|
||||
);
|
||||
await started.stop();
|
||||
const attemptsAfterStop = completeAttempts;
|
||||
await sleep(400);
|
||||
await vi.advanceTimersByTimeAsync(400);
|
||||
|
||||
expect(completeAttempts).toBe(attemptsAfterStop);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user