Skip to content

Commit

Permalink
Unskip APM API tests and fix flaky tests (elastic#168080)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored Oct 6, 2023
1 parent efa4e76 commit 5d660f9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
const registry = getService('registry');
const supertest = getService('supertest');
const es = getService('es');
const logger = getService('log');
const apmApiClient = getService('apmApiClient');
const synthtraceEsClient = getService('synthtraceEsClient');

Expand Down Expand Up @@ -133,9 +134,13 @@ export default function ApiTest({ getService }: FtrProviderContext) {
});

after(async () => {
await deleteActionConnector({ supertest, es, actionId });
await deleteRuleById({ supertest, ruleId });
await deleteAlertsByRuleId({ es, ruleId });
try {
await deleteActionConnector({ supertest, es, actionId });
await deleteRuleById({ supertest, ruleId });
await deleteAlertsByRuleId({ es, ruleId });
} catch (e) {
logger.info('Could not delete rule or action connector', e);
}
});

it('checks if rule is active', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
const registry = getService('registry');
const supertest = getService('supertest');
const es = getService('es');
const logger = getService('log');
const apmApiClient = getService('apmApiClient');
const synthtraceEsClient = getService('synthtraceEsClient');

Expand Down Expand Up @@ -106,9 +107,13 @@ export default function ApiTest({ getService }: FtrProviderContext) {
});

after(async () => {
await deleteActionConnector({ supertest, es, actionId });
await deleteAlertsByRuleId({ es, ruleId });
await deleteRuleById({ supertest, ruleId });
try {
await deleteActionConnector({ supertest, es, actionId });
await deleteRuleById({ supertest, ruleId });
await deleteAlertsByRuleId({ es, ruleId });
} catch (e) {
logger.info('Could not delete rule or action connector', e);
}
});

it('checks if rule is active', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
const registry = getService('registry');
const supertest = getService('supertest');
const es = getService('es');
const logger = getService('log');
const apmApiClient = getService('apmApiClient');
const synthtraceEsClient = getService('synthtraceEsClient');

Expand Down Expand Up @@ -116,9 +117,13 @@ export default function ApiTest({ getService }: FtrProviderContext) {
});

after(async () => {
await deleteActionConnector({ supertest, es, actionId });
await deleteRuleById({ supertest, ruleId });
await deleteAlertsByRuleId({ es, ruleId });
try {
await deleteActionConnector({ supertest, es, actionId });
await deleteRuleById({ supertest, ruleId });
await deleteAlertsByRuleId({ es, ruleId });
} catch (e) {
logger.info('Could not delete rule or action connector', e);
}
});

it('checks if rule is active', async () => {
Expand Down
5 changes: 1 addition & 4 deletions x-pack/test/apm_api_integration/tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ function getGlobPattern() {
export default function apmApiIntegrationTests({ getService, loadTestFile }: FtrProviderContext) {
const registry = getService('registry');

// Failing: See https://github.com/elastic/kibana/issues/167973
// FLAKY: https://github.com/elastic/kibana/issues/167974
// Failing: See https://github.com/elastic/kibana/issues/167975
describe.skip('APM API tests', function () {
describe('APM API tests', function () {
const filePattern = getGlobPattern();
const tests = globby.sync(filePattern, { cwd });

Expand Down

0 comments on commit 5d660f9

Please sign in to comment.