Skip to content

Commit

Permalink
[Security Solutions] Increases timeout and unskips detection tests (#…
Browse files Browse the repository at this point in the history
…126294)

## Summary

Increases the timeouts from 2 minutes to now 5 minutes and unskips the detection tests. If any of the tests fail consistently then I will skip just those individual tests instead of the whole suit.

See #125851 and elastic/elasticsearch#84256

This could cause issues with:
#125319

If so, then we will have to deal with the cloud based tests in a different way but in reality we need the extra time as some test cases do take a while to run on CI.

This also:
* Removes skips around code that have been in there for a while and adds documentation to the parts that are left over.

### Checklist
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
  • Loading branch information
FrankHassanabad authored Mar 15, 2022
1 parent 9871111 commit c060b9f
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default ({ getService }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
const log = getService('log');

describe.skip('open_close_signals', () => {
describe('open_close_signals', () => {
describe('tests with auditbeat data', () => {
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/auditbeat/hosts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default ({ getService }: FtrProviderContext) => {
});
});

// This fails and should be investigated or removed if it no longer applies
it.skip('should not give errors when querying and the signals index does exist and is empty', async () => {
await createSignalsIndex(supertest, log);
const { body } = await supertest
Expand Down Expand Up @@ -160,6 +161,7 @@ export default ({ getService }: FtrProviderContext) => {
});
});

// This fails and should be investigated or removed if it no longer applies
it.skip('should not give errors when querying and the signals index does exist and is empty', async () => {
await createSignalsIndex(supertest, log);
const { body } = await supertest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ export default ({ getService }: FtrProviderContext) => {
const log = getService('log');
const es = getService('es');

// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/125851
describe.skip('create_rules_with_exceptions', () => {
describe('create_rules_with_exceptions', () => {
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/auditbeat/hosts');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default ({ getService }: FtrProviderContext) => {
await esArchiver.unload('x-pack/test/functional/es_archives/signals/index_alias_clash');
});

// This fails and should be investigated or removed if it no longer applies
it.skip('should report that signals index does not exist', async () => {
const { body } = await supertest.get(DETECTION_ENGINE_INDEX_URL).send().expect(404);
expect(body).to.eql({ message: 'index for this space does not exist', status_code: 404 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ export default ({ getService }: FtrProviderContext) => {
return body;
}

// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/125851
describe.skip('Generating signals from ml anomalies', () => {
describe('Generating signals from ml anomalies', () => {
before(async () => {
// Order is critical here: auditbeat data must be loaded before attempting to start the ML job,
// as the job looks for certain indices on start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ export default ({ getService }: FtrProviderContext) => {
const supertestWithoutAuth = getService('supertestWithoutAuth');
const log = getService('log');

// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/125851
describe.skip('create_rules', () => {
describe('create_rules', () => {
describe('creating rules', () => {
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/auditbeat/hosts');
Expand Down Expand Up @@ -106,8 +105,7 @@ export default ({ getService }: FtrProviderContext) => {
await waitForRuleSuccessOrStatus(supertest, log, body.id);
});

// TODO: does the below test work?
it.skip('should create a single rule with a rule_id and an index pattern that does not match anything available and partial failure for the rule', async () => {
it('should create a single rule with a rule_id and an index pattern that does not match anything available and partial failure for the rule', async () => {
const simpleRule = getRuleForSignalTesting(['does-not-exist-*']);
const { body } = await supertest
.post(DETECTION_ENGINE_RULES_URL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ export default ({ getService }: FtrProviderContext) => {
/**
* Specific api integration tests for threat matching rule type
*/
// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/125851
describe.skip('create_threat_matching', () => {
describe('create_threat_matching', () => {
describe('creating threat match rule', () => {
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/auditbeat/hosts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export default ({ getService }: FtrProviderContext): void => {
expect(statusAfter.map((s) => s.is_outdated)).to.eql([false, false]);
});

// This fails and should be investigated or removed if it no longer applies
it.skip('deletes the underlying migration task', async () => {
await waitFor(
async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ export default ({ getService }: FtrProviderContext) => {
const es = getService('es');
const log = getService('log');

// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/125851
describe.skip('Generating signals from source indexes', () => {
describe('Generating signals from source indexes', () => {
beforeEach(async () => {
await deleteSignalsIndex(supertest, log);
await createSignalsIndex(supertest, log);
Expand Down Expand Up @@ -1160,7 +1159,7 @@ export default ({ getService }: FtrProviderContext) => {
});
});

describe.skip('Signal deduplication', async () => {
describe('Signal deduplication', async () => {
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/auditbeat/hosts');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { FtrProviderContext } from '../../common/ftr_provider_context';

// eslint-disable-next-line import/no-default-export
export default ({ loadTestFile }: FtrProviderContext): void => {
// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/125851
describe.skip('detection engine api security and spaces enabled', function () {
describe('detection engine api security and spaces enabled', function () {
describe('', function () {
this.tags('ciGroup11');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default ({ getService }: FtrProviderContext) => {
const log = getService('log');

describe('open_close_signals', () => {
describe.skip('validation checks', () => {
describe('validation checks', () => {
it('should not give errors when querying and the signals index does not exist yet', async () => {
const { body } = await supertest
.post(DETECTION_ENGINE_SIGNALS_STATUS_URL)
Expand Down Expand Up @@ -165,7 +165,8 @@ export default ({ getService }: FtrProviderContext) => {
expect(everySignalClosed).to.eql(true);
});

it('should be able to close signals with t1 analyst user', async () => {
// This fails and should be investigated or removed if it no longer applies
it.skip('should be able to close signals with t1 analyst user', async () => {
const rule = getRuleForSignalTesting(['auditbeat-*']);
const { id } = await createRule(supertest, log, rule);
await waitForRuleSuccessOrStatus(supertest, log, id);
Expand Down Expand Up @@ -200,7 +201,8 @@ export default ({ getService }: FtrProviderContext) => {
await deleteUserAndRole(getService, ROLES.t1_analyst);
});

it('should be able to close signals with soc_manager user', async () => {
// This fails and should be investigated or removed if it no longer applies
it.skip('should be able to close signals with soc_manager user', async () => {
const rule = getRuleForSignalTesting(['auditbeat-*']);
const { id } = await createRule(supertest, log, rule);
await waitForRuleSuccessOrStatus(supertest, log, id);
Expand Down
3 changes: 2 additions & 1 deletion x-pack/test/detection_engine_api_integration/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ export const getSimpleRulePreviewOutput = (
) => ({
logs,
previewId,
isAborted: false,
});

export const resolveSimpleRuleOutput = (
Expand Down Expand Up @@ -924,7 +925,7 @@ export const waitFor = async (
functionToTest: () => Promise<boolean>,
functionName: string,
log: ToolingLog,
maxTimeout: number = 100000,
maxTimeout: number = 400000,
timeoutWait: number = 250
): Promise<void> => {
let found = false;
Expand Down

0 comments on commit c060b9f

Please sign in to comment.