Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solutions] Reduces timeouts from 10 minutes per test down to 2 minutes and changes log.error to log.debug to avoid spamming #125432

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions x-pack/test/detection_engine_api_integration/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ export const waitFor = async (
functionToTest: () => Promise<boolean>,
functionName: string,
log: ToolingLog,
maxTimeout: number = 800000,
maxTimeout: number = 100000,
timeoutWait: number = 250
): Promise<void> => {
let found = false;
Expand Down Expand Up @@ -1324,7 +1324,7 @@ export const waitForAlertToComplete = async (
async () => {
const response = await supertest.get(`/api/alerts/alert/${id}/state`).set('kbn-xsrf', 'true');
if (response.status !== 200) {
log.error(
log.debug(
`Did not get an expected 200 "ok" when waiting for an alert to complete (waitForAlertToComplete). CI issues could happen. Suspect this line if you are seeing CI issues. body: ${JSON.stringify(
response.body
)}, status: ${JSON.stringify(response.status)}`
Expand Down Expand Up @@ -1357,7 +1357,7 @@ export const waitForRuleSuccessOrStatus = async (
.set('kbn-xsrf', 'true')
.query({ id });
if (response.status !== 200) {
log.error(
log.debug(
`Did not get an expected 200 "ok" when waiting for a rule success or status (waitForRuleSuccessOrStatus). CI issues could happen. Suspect this line if you are seeing CI issues. body: ${JSON.stringify(
response.body
)}, status: ${JSON.stringify(response.status)}`
Expand Down Expand Up @@ -1411,9 +1411,7 @@ export const waitForSignalsToBePresent = async (
return signalsOpen.hits.hits.length >= numberOfSignals;
},
'waitForSignalsToBePresent',
log,
20000,
250 // Wait 250ms between tries
log
);
};

Expand Down