Fix savedObjectsTagging FTR test flakiness (#121626) (#121648)

* Fix savedObjectsTagging FTR test flakiness

* set default value for refreshCache

Co-authored-by: Pierre Gayvallet <pierre.gayvallet@elastic.co>
This commit is contained in:
Kibana Machine 2021-12-20 11:21:12 -05:00 committed by GitHub
parent 381dc13b93
commit 84dccccdda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -40,11 +40,12 @@ export function UsageAPIProvider({ getService }: FtrProviderContext) {
*/
async getTelemetryStats(payload: {
unencrypted?: boolean;
refreshCache?: boolean;
}): Promise<ReturnType<TelemetryCollectionManagerPlugin['getStats']>> {
const { body } = await supertest
.post('/api/telemetry/v2/clusters/_stats')
.set('kbn-xsrf', 'xxx')
.send(payload)
.send({ refreshCache: true, ...payload })
.expect(200);
return body;
},

View file

@ -42,6 +42,7 @@ export default function ({ getService }: FtrProviderContext) {
it('collects the expected data', async () => {
const [{ stats: telemetryStats }] = (await usageAPI.getTelemetryStats({
unencrypted: true,
refreshCache: true,
})) as any;
const taggingStats = telemetryStats.stack_stats.kibana.plugins.saved_objects_tagging;