From 6d79b6751dbb345c477e542dfd222e5ac222d6b5 Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Thu, 7 Sep 2023 07:57:32 +0200 Subject: [PATCH] [Discover] Unskip "search source fetch" flaky tests (#165586) Normal test: - Closes https://github.com/elastic/kibana/issues/139879 100x https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3056 100x https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3070 Similar Serverless tests: - https://github.com/elastic/kibana/issues/165660 - https://github.com/elastic/kibana/issues/165624 - https://github.com/elastic/kibana/issues/165623 - https://github.com/elastic/kibana/issues/165503 - https://github.com/elastic/kibana/issues/165502 - https://github.com/elastic/kibana/issues/165379 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- test/examples/search/warnings.ts | 19 +++++++++++++------ .../common/examples/search/warnings.ts | 16 ++++++++++++---- x-pack/test_serverless/tsconfig.json | 2 +- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/test/examples/search/warnings.ts b/test/examples/search/warnings.ts index 3f2166447f6520..5ec4f59586a13d 100644 --- a/test/examples/search/warnings.ts +++ b/test/examples/search/warnings.ts @@ -26,8 +26,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver'); - // Failing: See https://github.com/elastic/kibana/issues/139879 - describe.skip('handling warnings with search source fetch', function () { + describe('handling warnings with search source fetch', function () { const dataViewTitle = 'sample-01,sample-01-rollup'; const fromTime = 'Jun 17, 2022 @ 00:00:00.000'; const toTime = 'Jun 23, 2022 @ 00:00:00.000'; @@ -122,8 +121,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // click "see full error" button in the toast const [openShardModalButton] = await testSubjects.findAll('openShardFailureModalBtn'); await openShardModalButton.click(); - const modalHeader = await testSubjects.find('shardFailureModalTitle'); - expect(await modalHeader.getVisibleText()).to.be('2 of 4 shards failed'); + + await retry.waitFor('modal title visible', async () => { + const modalHeader = await testSubjects.find('shardFailureModalTitle'); + return (await modalHeader.getVisibleText()) === '2 of 4 shards failed'; + }); + // request await testSubjects.click('shardFailuresModalRequestButton'); const requestBlock = await testSubjects.find('shardsFailedModalRequestBlock'); @@ -169,8 +172,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const [openShardModalButton] = await testSubjects.findAll('openShardFailureModalBtn'); await openShardModalButton.click(); await testSubjects.exists('shardFailureModalTitle'); - const modalHeader = await testSubjects.find('shardFailureModalTitle'); - expect(await modalHeader.getVisibleText()).to.be('2 of 4 shards failed'); + + await retry.waitFor('modal title visible', async () => { + const modalHeader = await testSubjects.find('shardFailureModalTitle'); + return (await modalHeader.getVisibleText()) === '2 of 4 shards failed'; + }); + // request await testSubjects.click('shardFailuresModalRequestButton'); const requestBlock = await testSubjects.find('shardsFailedModalRequestBlock'); diff --git a/x-pack/test_serverless/functional/test_suites/common/examples/search/warnings.ts b/x-pack/test_serverless/functional/test_suites/common/examples/search/warnings.ts index 01808d0a3175ba..a98cc05f0bfd3c 100644 --- a/x-pack/test_serverless/functional/test_suites/common/examples/search/warnings.ts +++ b/x-pack/test_serverless/functional/test_suites/common/examples/search/warnings.ts @@ -125,8 +125,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // click "see full error" button in the toast const [openShardModalButton] = await testSubjects.findAll('openShardFailureModalBtn'); await openShardModalButton.click(); - const modalHeader = await testSubjects.find('shardFailureModalTitle'); - expect(await modalHeader.getVisibleText()).to.be('2 of 4 shards failed'); + + await retry.waitFor('modal title visible', async () => { + const modalHeader = await testSubjects.find('shardFailureModalTitle'); + return (await modalHeader.getVisibleText()) === '2 of 4 shards failed'; + }); + // request await testSubjects.click('shardFailuresModalRequestButton'); const requestBlock = await testSubjects.find('shardsFailedModalRequestBlock'); @@ -171,8 +175,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // click "see full error" button in the toast const [openShardModalButton] = await testSubjects.findAll('openShardFailureModalBtn'); await openShardModalButton.click(); - const modalHeader = await testSubjects.find('shardFailureModalTitle'); - expect(await modalHeader.getVisibleText()).to.be('2 of 4 shards failed'); + + await retry.waitFor('modal title visible', async () => { + const modalHeader = await testSubjects.find('shardFailureModalTitle'); + return (await modalHeader.getVisibleText()) === '2 of 4 shards failed'; + }); + // request await testSubjects.click('shardFailuresModalRequestButton'); const requestBlock = await testSubjects.find('shardsFailedModalRequestBlock'); diff --git a/x-pack/test_serverless/tsconfig.json b/x-pack/test_serverless/tsconfig.json index de711146da7ec1..3950afef67928a 100644 --- a/x-pack/test_serverless/tsconfig.json +++ b/x-pack/test_serverless/tsconfig.json @@ -45,7 +45,6 @@ "@kbn/cases-plugin", "@kbn/test-subj-selector", "@kbn/core-http-common", - "@kbn/std", "@kbn/data-views-plugin", "@kbn/core-saved-objects-server", "@kbn/security-api-integration-helpers", @@ -54,5 +53,6 @@ "@kbn/dev-utils", "@kbn/bfetch-plugin", "@kbn/rison", + "@kbn/std", ] }