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 cc97c7d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/end2end.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,6 @@ jobs:
username: "${{ github.repository_owner }}"
password: "${{ github.token }}"
registry: ghcr.io
- name: Debug wait
uses: ./.github/actions/debug-wait
timeout-minutes: 60
if: always()
- name: Deploy Zenko
uses: ./.github/actions/deploy
env:
Expand Down
16 changes: 6 additions & 10 deletions tests/ctst/steps/dr/drctl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,16 @@ type FailbackConfig = {
};

type UninstallConfig = {
sinkZenkoDrInstance?: string;
sourceZenkoDrInstance?: string;
wait?: boolean;
timeout?: string;
sourceKubeconfigPath?: string;
sourceKubeconfigData?: string;
sinkKubeconfigPath?: string;
sinkKubeconfigData?: string;
sinkZenkoInstance?: string;
sinkZenkoNamespace?: string;
sourceZenkoInstance?: string;
sourceZenkoNamespace?: string;
sinkZenkoDrInstance?: string;
sinkZenkoDrNamespace?: string;
sourceZenkoDrInstance?: string;
sourceZenkoDrNamespace?: string;
};

type StatusConfig = {
Expand Down Expand Up @@ -169,10 +167,8 @@ type ReplicationResumeConfig = {
sourceKubeconfigData?: string;
sinkKubeconfigPath?: string;
sinkKubeconfigData?: string;
sourceZenkoInstance?: string;
sourceZenkoNamespace?: string;
sinkZenkoInstance?: string;
sinkZenkoNamespace?: string;
sourceZenkoDrNamespace?: string;
sinkZenkoDrNamespace?: string;
sourceZenkoDrInstance?: string;
sinkZenkoDrInstance?: string;
wait?: boolean;
Expand Down
10 changes: 5 additions & 5 deletions tests/ctst/steps/pra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ When('I resume the DR', { timeout: resumeTimeout + 2000 }, async function (this:
await this.zenkoDrCtl?.replicationResume({
sourceZenkoDrInstance: 'end2end-source',
sinkZenkoDrInstance: 'end2end-pra-sink',
sinkZenkoNamespace: 'default',
sourceZenkoNamespace: 'default',
sinkZenkoDrNamespace: 'default',
sourceZenkoDrNamespace: 'default',
wait: true,
timeout: `${resumeTimeout.toString()}ms`,
timeout: `${pauseTimeout.toString()}ms`,
});
});

Expand All @@ -372,8 +372,8 @@ When('I uninstall DR', { timeout: uninstallTimeout + 2000 }, async function (thi
await this.zenkoDrCtl?.uninstall({
sourceZenkoDrInstance: 'end2end-source',
sinkZenkoDrInstance: 'end2end-pra-sink',
sinkZenkoNamespace: 'default',
sourceZenkoNamespace: 'default',
sinkZenkoDrNamespace: 'default',
sourceZenkoDrNamespace: 'default',
wait: true,
timeout: `${uninstallTimeout.toString()}ms`,
});
Expand Down
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 cc97c7d

Please sign in to comment.