From 377b14fca67554e73962e0ad9b4b75e706d7f4c4 Mon Sep 17 00:00:00 2001 From: mesalogo Date: Thu, 8 Oct 2026 14:38:59 +0800 Subject: [PATCH] test: use immediate cancellation signal --- src/main/desktop-storage-electron-fixture.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/desktop-storage-electron-fixture.ts b/src/main/desktop-storage-electron-fixture.ts index 6daafdfa..23b00a97 100644 --- a/src/main/desktop-storage-electron-fixture.ts +++ b/src/main/desktop-storage-electron-fixture.ts @@ -232,10 +232,8 @@ async function run(): Promise { const cancelled = new DesktopStorageClient(options) await cancelled.ready const cancelledChange = largeChange('Cancelled write') - const cancellation = new AbortController() - const cancelledRequest = cancelled.call('assistant', 'saveLocalConversations', [cancelledChange], { signal: cancellation.signal }) - cancellation.abort() - await assert.rejects(cancelledRequest, { name: 'AbortError' }) + const cancellation = AbortSignal.abort() + await assert.rejects(cancelled.call('assistant', 'saveLocalConversations', [cancelledChange], { signal: cancellation }), { name: 'AbortError' }) assert.deepEqual(await cancelled.call('assistant', 'searchConversations', ['Cancelled write']), []) await cancelled.close()