diff --git a/x-pack/test/common/services/ingest_manager.ts b/x-pack/test/common/services/ingest_manager.ts index 96b1b97a68dc9..2fcfaa014b2e1 100644 --- a/x-pack/test/common/services/ingest_manager.ts +++ b/x-pack/test/common/services/ingest_manager.ts @@ -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); + }); }, }; }