Skip to content

Commit

Permalink
add retry
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Oct 23, 2024
1 parent ec7d039 commit bbfa32a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions test/functional/apps/dashboard/group4/dashboard_listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const listingTable = getService('listingTable');
const dashboardAddPanel = getService('dashboardAddPanel');
const testSubjects = getService('testSubjects');
const retry = getService('retry');

describe('dashboard listing page', function describeIndexTests() {
const dashboardName = 'Dashboard Listing Test';
Expand Down Expand Up @@ -272,15 +273,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await listingTable.clickItemLink('dashboard', DASHBOARD_NAME);
await dashboard.waitForRenderComplete();
await dashboard.gotoDashboardLandingPage();
try {
const views2 = await getViewsCount();
expect(views2).to.be(2);
} catch (e) {
// Retry just once in case of flakiness
// it might be that the views count is not updated yet

// it might take a bit for the view to be counted
await retry.try(async () => {
const views2 = await getViewsCount();
expect(views2).to.be(2);
}
});
});
});
});
Expand Down

0 comments on commit bbfa32a

Please sign in to comment.