Skip to content

Commit

Permalink
Add timeout for not found as during a replication pause it is normal …
Browse files Browse the repository at this point in the history
…not to find the object

Issue: ZENKO-4903
  • Loading branch information
KillianG committed Oct 4, 2024
1 parent a169989 commit 262a00f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/ctst/steps/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,15 @@ async function verifyObjectLocation(this: Zenko, objectName: string,
this.addCommandParameter({ versionId });
}
let conditionOk = false;

const startTime = Date.now();

while (!conditionOk) {
const res = await S3.headObject(this.getCommandParameters());
if (res.err?.includes('NotFound')) {
if (Date.now() - startTime > 300000) {
throw new Error('Object not found after 300 seconds');
}
await Utils.sleep(1000);
continue;
} else if (res.err) {
Expand Down

0 comments on commit 262a00f

Please sign in to comment.