Skip to content

Commit

Permalink
Fixed delay before environment ready
Browse files Browse the repository at this point in the history
  • Loading branch information
dkirchan committed Nov 3, 2023
1 parent 954c08f commit 691d8c7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ const PROJECT_NAME_PREFIX = 'kibana-cypress-security-solution-ephemeral';
const BASE_ENV_URL = 'https://global.qa.cld.elstc.co';
let log: ToolingLog;

const delay = async (timeout: number) => {
await new Promise((r) => setTimeout(r, timeout));
};

const getApiKeyFromElasticCloudJsonFile = (): string | undefined => {
const userHomeDir = os.homedir();
try {
Expand Down Expand Up @@ -198,7 +202,6 @@ function waitForKibanaAvailable(kbUrl: string, auth: string, runnerId: string):
} else {
log.info(`${runnerId}: ${error}`);
}
throw new Error(`${runnerId} - ${error}`);
},
retries: 50,
factor: 2,
Expand Down Expand Up @@ -365,6 +368,9 @@ ${JSON.stringify(cypressConfigFile, null, 2)}
return process.exit(1);
}

// Wait for 4 minutes in order for the environment to be ready
delay(240000);

// Base64 encode the credentials in order to invoke ES and KB APIs
const auth = btoa(`${credentials.username}:${credentials.password}`);

Expand Down

0 comments on commit 691d8c7

Please sign in to comment.