[Alerting] Fixing flaky tests (#111366)

* Unskipping test

* Retrying deletes

* Unskipping test

* Changing fn signature

* hmm

* Removing unnecessary code

* Unskipping test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
ymao1 2021-09-09 09:43:42 -04:00 committed by GitHub
parent 36cec00c6d
commit 334f129bcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 23 deletions

View file

@ -672,6 +672,14 @@ export class RulesClient {
}
public async delete({ id }: { id: string }) {
return await retryIfConflicts(
this.logger,
`rulesClient.delete('${id}')`,
async () => await this.deleteWithOCC({ id })
);
}
private async deleteWithOCC({ id }: { id: string }) {
let taskIdToRemove: string | undefined | null;
let apiKeyToInvalidate: string | null = null;
let attributes: RawAlert;

View file

@ -39,8 +39,7 @@ export default function alertTests({ getService }: FtrProviderContext) {
const esTestIndexTool = new ESTestIndexTool(es, retry);
const taskManagerUtils = new TaskManagerUtils(es, retry);
// FLAKY: https://github.com/elastic/kibana/issues/106492
describe.skip('alerts', () => {
describe('alerts', () => {
const authorizationIndex = '.kibana-test-authorization';
const objectRemover = new ObjectRemover(supertest);
@ -502,19 +501,6 @@ instanceStateValue: true
})
);
// Enqueue non ephemerically so we the latter code can query properly
const enqueueResponse = await supertest
.post(`${getUrlPrefix(space.id)}/api/alerts_fixture/${createdAction.id}/enqueue_action`)
.set('kbn-xsrf', 'foo')
.send({
params: {
reference,
index: ES_TEST_INDEX_NAME,
retryAt: retryDate.getTime(),
},
});
expect(enqueueResponse.status).to.eql(204);
switch (scenario.id) {
case 'no_kibana_privileges at space1':
case 'global_read at space1':

View file

@ -23,8 +23,7 @@ export default function createDeleteTests({ getService }: FtrProviderContext) {
const retry = getService('retry');
const supertestWithoutAuth = getService('supertestWithoutAuth');
// FLAKY https://github.com/elastic/kibana/issues/111001
describe.skip('delete', () => {
describe('delete', () => {
const objectRemover = new ObjectRemover(supertest);
after(() => objectRemover.removeAll());

View file

@ -17,8 +17,7 @@ export default function createFindTests({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const supertestWithoutAuth = getService('supertestWithoutAuth');
// FLAKY https://github.com/elastic/kibana/issues/111022
describe.skip('find', () => {
describe('find', () => {
const objectRemover = new ObjectRemover(supertest);
afterEach(() => objectRemover.removeAll());

View file

@ -21,8 +21,7 @@ export default function createGetTests({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const supertestWithoutAuth = getService('supertestWithoutAuth');
// FLAKY https://github.com/elastic/kibana/issues/111496
describe.skip('get', () => {
describe('get', () => {
const objectRemover = new ObjectRemover(supertest);
afterEach(() => objectRemover.removeAll());

View file

@ -32,8 +32,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) {
.then((response: SupertestResponse) => response.body);
}
// FLAKY: https://github.com/elastic/kibana/issues/110801
describe.skip('update', () => {
describe('update', () => {
const objectRemover = new ObjectRemover(supertest);
after(() => objectRemover.removeAll());