From 75933e164bd69d1e863d910234986e772ff752d7 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 25 Oct 2024 02:11:01 +1100 Subject: [PATCH] [8.x] fix flaky test - counts dashboard views (#197381) (#197643) # Backport This will backport the following commits from `main` to `8.x`: - [fix flaky test - counts dashboard views (#197381)](https://github.com/elastic/kibana/pull/197381) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Anton Dosov --- .../apps/dashboard/group4/dashboard_listing.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/functional/apps/dashboard/group4/dashboard_listing.ts b/test/functional/apps/dashboard/group4/dashboard_listing.ts index 14eb5e3ae1f45..9f11f181bf51e 100644 --- a/test/functional/apps/dashboard/group4/dashboard_listing.ts +++ b/test/functional/apps/dashboard/group4/dashboard_listing.ts @@ -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'); // Failing: See https://github.com/elastic/kibana/issues/192564 describe.skip('dashboard listing page', function describeIndexTests() { @@ -272,8 +273,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await listingTable.clickItemLink('dashboard', DASHBOARD_NAME); await dashboard.waitForRenderComplete(); await dashboard.gotoDashboardLandingPage(); - const views2 = await getViewsCount(); - expect(views2).to.be(2); + + // it might take a bit for the view to be counted + await retry.try(async () => { + const views2 = await getViewsCount(); + expect(views2).to.be(2); + }); }); }); });