Skip to content

Commit

Permalink
Fix timeout for dr install
Browse files Browse the repository at this point in the history
`drctl install` already does wait, so it may take some time; and no
point waiting for state to change afterwards.

Issue: ZENKO-4876
  • Loading branch information
francoisferrand committed Aug 20, 2024
1 parent 9162ec1 commit 5e88bc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/ctst/features/pra.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: PRA operations
Given a DR installed
Then the DR source should be in phase "Running"
And the DR sink should be in phase "Running"
Then the kafka DR volume exists
And the kafka DR volume should exists

# Check that objects are transitioned in the DR site
Given access keys for the replicated account
Expand Down
19 changes: 8 additions & 11 deletions tests/ctst/steps/pra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export async function displayDebuggingInformation(world: Zenko) {
});
}

async function waitForPhase(
async function verifyPhase(
world: Zenko,
target: 'source' | 'sink',
state: ZenkoDrSinkPhases | ZenkoDrSourcePhases,
Expand Down Expand Up @@ -152,16 +152,13 @@ async function waitForPhase(
target,
});

if (phase === state) {
return true;
}
await Utils.sleep(1000);
return phase === state;
}

return false;
}

Given('a DR installed', { timeout: 130000 }, async function (this: Zenko) {
Given('a DR installed', { timeout: 360000 }, async function (this: Zenko) {
Identity.useIdentity(IdentityEnum.ACCOUNT, Zenko.sites['source'].accountName);
const credentials = Identity.getCurrentCredentials();
await createSecret(this, 'drctl-s3-creds', {
Expand All @@ -183,7 +180,7 @@ Given('a DR failing to be installed', { timeout: 130000 }, async function (this:
return;
});

Then('the DR sink should be in phase {string}', { timeout: 360000 }, async function (this: Zenko, state: string) {
Then('the DR sink should be in phase {string}', { timeout: 10000 }, async function (this: Zenko, state: string) {
let targetPhase;
switch (state) {
case 'New':
Expand Down Expand Up @@ -211,10 +208,10 @@ Then('the DR sink should be in phase {string}', { timeout: 360000 }, async funct
throw new Error(`Unknown state ${state}`);
}

await waitForPhase(this, 'sink', targetPhase);
await verifyPhase(this, 'sink', targetPhase);
});

Then('the DR source should be in phase {string}', { timeout: 360000 }, async function (this: Zenko, state: string) {
Then('the DR source should be in phase {string}', { timeout: 10000 }, async function (this: Zenko, state: string) {
let targetPhase;
switch (state) {
case 'New':
Expand All @@ -239,7 +236,7 @@ Then('the DR source should be in phase {string}', { timeout: 360000 }, async fun
throw new Error(`Unknown state ${state}`);
}

await waitForPhase(this, 'source', targetPhase);
await verifyPhase(this, 'source', targetPhase);
});

Then('object {string} should {string} be {string} and have the storage class {string} on {string} site',
Expand Down Expand Up @@ -270,7 +267,7 @@ Then('object {string} should {string} be {string} and have the storage class {st
}
});

Then('the kafka DR volume exists', { timeout: 60000 }, async function (this: Zenko) {
Then('the kafka DR volume should exists', { timeout: 60000 }, async function (this: Zenko) {
const volumeClaim = await getPVCFromLabel(this, 'kafka_cr', 'end2end-pra-sink-base-queue');
this.logger.debug('kafka volume claim', { volumeClaim });
assert(volumeClaim);
Expand Down

0 comments on commit 5e88bc4

Please sign in to comment.