[SECURITY_SOLUTION] Retry on ingest setup (#75000)

This commit is contained in:
Kevin Logan 2020-08-14 10:06:51 -04:00 committed by GitHub
parent 187a13075b
commit 8aa8b04cee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,15 +8,18 @@ import { fleetSetupRouteService } from '../../../plugins/ingest_manager/common';
export function IngestManagerProvider({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const retry = getService('retry');
return {
async setup() {
const headers = { accept: 'application/json', 'kbn-xsrf': 'some-xsrf-token' };
await supertest
.post(fleetSetupRouteService.postFleetSetupPath())
.set(headers)
.send({ forceRecreate: true })
.expect(200);
await retry.try(async () => {
await supertest
.post(fleetSetupRouteService.postFleetSetupPath())
.set(headers)
.send({ forceRecreate: true })
.expect(200);
});
},
};
}