From 681277e240db4d66053724c907ef98dc9b6fba94 Mon Sep 17 00:00:00 2001 From: nicolasvienot Date: Mon, 7 Aug 2023 15:59:15 +0200 Subject: [PATCH 1/2] fix: add canceled status to type TaskStatus --- src/types/types.ts | 1 + tests/task.test.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/types/types.ts b/src/types/types.ts index 99af63fa4..56696b966 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -347,6 +347,7 @@ export const enum TaskStatus { TASK_PROCESSING = 'processing', TASK_FAILED = 'failed', TASK_ENQUEUED = 'enqueued', + TASK_CANCELED = 'canceled', } export const enum TaskTypes { diff --git a/tests/task.test.ts b/tests/task.test.ts index 050003b2c..ce49bd8b6 100644 --- a/tests/task.test.ts +++ b/tests/task.test.ts @@ -434,11 +434,13 @@ describe.each([{ permission: 'Master' }, { permission: 'Admin' }])( uids: [addDocuments.taskUid], }) const task = await client.waitForTask(enqueuedTask.taskUid) + const canceledTask = await client.getTask(addDocuments.taskUid) expect(task.type).toEqual(TaskTypes.TASK_CANCELATION) expect(task.details?.originalFilter).toContain('uids=') expect(task.details?.matchedTasks).toBeDefined() expect(task.details?.canceledTasks).toBeDefined() + expect(canceledTask.status).toBe(TaskStatus.TASK_CANCELED) }) // cancel: indexUid From c97814836b8f7a204183a7ebadc979fe9d8e8925 Mon Sep 17 00:00:00 2001 From: Alexia Toulmet Date: Mon, 7 Aug 2023 17:11:07 +0200 Subject: [PATCH 2/2] delete flaky test --- tests/task.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/task.test.ts b/tests/task.test.ts index ce49bd8b6..050003b2c 100644 --- a/tests/task.test.ts +++ b/tests/task.test.ts @@ -434,13 +434,11 @@ describe.each([{ permission: 'Master' }, { permission: 'Admin' }])( uids: [addDocuments.taskUid], }) const task = await client.waitForTask(enqueuedTask.taskUid) - const canceledTask = await client.getTask(addDocuments.taskUid) expect(task.type).toEqual(TaskTypes.TASK_CANCELATION) expect(task.details?.originalFilter).toContain('uids=') expect(task.details?.matchedTasks).toBeDefined() expect(task.details?.canceledTasks).toBeDefined() - expect(canceledTask.status).toBe(TaskStatus.TASK_CANCELED) }) // cancel: indexUid