Skip to content

Commit

Permalink
Fix locking stale
Browse files Browse the repository at this point in the history
Issue: ZENKO-4941
  • Loading branch information
williamlardier committed Dec 4, 2024
1 parent 8ca5bf7 commit 833cc32
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/ctst/steps/utils/kubernetes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);

Expand Down

0 comments on commit 833cc32

Please sign in to comment.