From 70fa0986e88be9bb2603542277310c46ed00bef0 Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Tue, 10 Mar 2020 12:45:49 -0400 Subject: [PATCH] Add a retry to dashboard test for a sometimes slow async operation (#59600) --- test/functional/apps/dashboard/dashboard_query_bar.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/functional/apps/dashboard/dashboard_query_bar.js b/test/functional/apps/dashboard/dashboard_query_bar.js index dc4c6a9a63d4d..13dea27f606f6 100644 --- a/test/functional/apps/dashboard/dashboard_query_bar.js +++ b/test/functional/apps/dashboard/dashboard_query_bar.js @@ -24,6 +24,7 @@ export default function({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); const pieChart = getService('pieChart'); const queryBar = getService('queryBar'); + const retry = getService('retry'); const PageObjects = getPageObjects(['common', 'dashboard', 'discover']); describe('dashboard query bar', () => { @@ -41,10 +42,11 @@ export default function({ getService, getPageObjects }) { await esArchiver.unload('dashboard/current/data'); await queryBar.clickQuerySubmitButton(); - const headers = await PageObjects.discover.getColumnHeaders(); - expect(headers.length).to.be(0); - - await pieChart.expectPieSliceCount(0); + await retry.tryForTime(5000, async () => { + const headers = await PageObjects.discover.getColumnHeaders(); + expect(headers.length).to.be(0); + await pieChart.expectPieSliceCount(0); + }); }); }); }