From e15c92474289bae215bccd45086c6618253ecc75 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 2 Feb 2022 10:44:48 +0300 Subject: [PATCH] fix client recreate testcase flow also added sleep function to the deps to use it in the future --- .../api/cli/POST-instance-id-cli-uuid-send_command.test.ts | 5 ++++- redisinsight/api/test/helpers/test.ts | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/redisinsight/api/test/api/cli/POST-instance-id-cli-uuid-send_command.test.ts b/redisinsight/api/test/api/cli/POST-instance-id-cli-uuid-send_command.test.ts index 7742e64d36..ba5e28740c 100644 --- a/redisinsight/api/test/api/cli/POST-instance-id-cli-uuid-send_command.test.ts +++ b/redisinsight/api/test/api/cli/POST-instance-id-cli-uuid-send_command.test.ts @@ -869,7 +869,7 @@ describe('POST /instance/:instanceId/cli/:uuid/send-command', () => { before: async function () { // unblock command after 1 sec setTimeout(async () => { - await request(server).patch(`/instance/${constants.TEST_INSTANCE_ID}/cli/${constants.TEST_CLI_UUID_1}`); + await request(server).delete(`/instance/${constants.TEST_INSTANCE_ID}/cli/${constants.TEST_CLI_UUID_1}`); }, 1000) }, }, @@ -880,6 +880,9 @@ describe('POST /instance/:instanceId/cli/:uuid/send-command', () => { outputFormat: 'TEXT', }, responseSchema, + before: async () => { + await request(server).patch(`/instance/${constants.TEST_INSTANCE_ID}/cli/${constants.TEST_CLI_UUID_1}`); + }, after: async () => { expect(await rte.client.exists(constants.TEST_LIST_KEY_1)).to.eql(0); } diff --git a/redisinsight/api/test/helpers/test.ts b/redisinsight/api/test/helpers/test.ts index f434e17afb..6bdd18500c 100644 --- a/redisinsight/api/test/helpers/test.ts +++ b/redisinsight/api/test/helpers/test.ts @@ -194,3 +194,5 @@ export const getMainCheckFn = (endpoint) => async (testCase) => { } }); }; + +export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));