From 0768183c55346e4090d97c2268207f4df0be05a3 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Tue, 9 May 2023 08:16:40 +0530 Subject: [PATCH] test: kludge- webhook CI failure Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/tests/db/01-webhook.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/playwright/tests/db/01-webhook.spec.ts b/tests/playwright/tests/db/01-webhook.spec.ts index cf0dce6e4d..cf6e1198fe 100644 --- a/tests/playwright/tests/db/01-webhook.spec.ts +++ b/tests/playwright/tests/db/01-webhook.spec.ts @@ -23,6 +23,9 @@ async function clearServerData({ request }) { async function getWebhookResponses({ request, count = 1 }) { let response; + // add delay ensuring the server has received the request + await new Promise(resolve => setTimeout(resolve, 1000)); + // retry since there can be lag between the time the hook is triggered and the time the server receives the request for (let i = 0; i < 20; i++) { response = await request.get(hookPath + '/count'); @@ -425,6 +428,9 @@ test.describe.serial('Webhook', () => { test('Bulk operations', async ({ request, page }) => { async function verifyBulkOperationTrigger(rsp, type) { + // add delay to make sure bulk operation is completed + await new Promise(resolve => setTimeout(resolve, 1000)); + for (let i = 0; i < rsp.length; i++) { expect(rsp[i].type).toBe(type); expect(rsp[i].data.table_name).toBe('Test');