Skip to content

Commit

Permalink
Add retries to data view checks in test
Browse files Browse the repository at this point in the history
  • Loading branch information
kpollich committed Nov 30, 2023
1 parent 1dc9f70 commit bdd289f
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/
import expect from '@kbn/expect';
import pRetry from 'p-retry';
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
import { skipIfNoDockerRegistry } from '../../helpers';
import { setupFleetAndAgents } from '../agents/services';
Expand Down Expand Up @@ -88,15 +89,24 @@ export default function (providerContext: FtrProviderContext) {

it('should install kibana assets', async function () {
// These are installed from Fleet along with every package
const resIndexPatternLogs = await kibanaServer.savedObjects.get({
type: 'index-pattern',
id: 'logs-*',
});
const resIndexPatternLogs = await pRetry(
() =>
kibanaServer.savedObjects.get({
type: 'index-pattern',
id: 'logs-*',
}),
{ retries: 3 }
);
expect(resIndexPatternLogs.id).equal('logs-*');
const resIndexPatternMetrics = await kibanaServer.savedObjects.get({
type: 'index-pattern',
id: 'metrics-*',
});

const resIndexPatternMetrics = await pRetry(
() =>
kibanaServer.savedObjects.get({
type: 'index-pattern',
id: 'metrics-*',
}),
{ retries: 3 }
);
expect(resIndexPatternMetrics.id).equal('metrics-*');
});

Expand Down

0 comments on commit bdd289f

Please sign in to comment.