From 833cc32b7e328713e856257e1bafc85abb5417a9 Mon Sep 17 00:00:00 2001 From: williamlardier Date: Wed, 4 Dec 2024 10:17:44 +0100 Subject: [PATCH] Fix locking stale Issue: ZENKO-4941 --- tests/ctst/steps/utils/kubernetes.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/ctst/steps/utils/kubernetes.ts b/tests/ctst/steps/utils/kubernetes.ts index d7b0a4db9..a7fcc6ed0 100644 --- a/tests/ctst/steps/utils/kubernetes.ts +++ b/tests/ctst/steps/utils/kubernetes.ts @@ -90,10 +90,17 @@ export async function createJobAndWaitForCompletion( } try { - // Acquire lock on the file with 0.5s staleness and 1200 retries releaseLock = await lockFile.lock(lockFilePath, { - stale: 5000, - retries: 1200, + // Expect the job does not take more than 2 minutes to complete + stale: 2 * 60 * 1000, + // use a non-exponential backoff strategy + // try once per second for 2min + retries: { + retries: 120, + factor: 1, + minTimeout: 1000, + maxTimeout: 1000, + }, }); world.logger.debug(`Acquired lock for job: ${jobName}`);