Skip to content

Commit

Permalink
[SECURITY_SOLUTION] Retry on ingest setup (#75000) (#75043)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlog authored Aug 14, 2020
1 parent a5124c4 commit 536cac8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions x-pack/test/common/services/ingest_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
},
};
}

0 comments on commit 536cac8

Please sign in to comment.