From 87261f1a68062965ba76b9541349a19202b7217b Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Tue, 28 Feb 2023 12:29:27 +0100 Subject: [PATCH 1/5] [ML] Functional tests - stabilize and re-enable export jobs tests --- .../functional/apps/ml/stack_management_jobs/export_jobs.ts | 5 +++-- x-pack/test/functional/services/ml/stack_management_jobs.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts b/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts index 6ec33c155a813..1a95d0cb9caab 100644 --- a/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts +++ b/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts @@ -251,9 +251,9 @@ export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const ml = getService('ml'); - // Failing: See https://github.com/elastic/kibana/issues/150557 - describe.skip('export jobs', function () { + describe('export jobs', function () { this.tags(['ml']); + before(async () => { await ml.api.cleanMlIndices(); await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote'); @@ -282,6 +282,7 @@ export default function ({ getService }: FtrProviderContext) { await ml.navigation.navigateToStackManagement(); await ml.navigation.navigateToStackManagementJobsListPage(); }); + after(async () => { await ml.api.cleanMlIndices(); ml.stackManagementJobs.deleteExportedFiles([ diff --git a/x-pack/test/functional/services/ml/stack_management_jobs.ts b/x-pack/test/functional/services/ml/stack_management_jobs.ts index 48a783de58389..be7d6e49537e1 100644 --- a/x-pack/test/functional/services/ml/stack_management_jobs.ts +++ b/x-pack/test/functional/services/ml/stack_management_jobs.ts @@ -326,7 +326,7 @@ export function MachineLearningStackManagementJobsProvider({ }, async getDownload(filePath: string) { - return retry.tryForTime(5000, async () => { + return retry.tryForTime(60 * 1000, async () => { expect(fs.existsSync(filePath)).to.be(true); return fs.readFileSync(filePath).toString(); }); From 90b07825f5335c18178ed1dd49eb18bdd4939dc6 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Tue, 28 Feb 2023 16:55:23 +0100 Subject: [PATCH 2/5] Revert increased timeout, add better assertion message --- x-pack/test/functional/services/ml/stack_management_jobs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/test/functional/services/ml/stack_management_jobs.ts b/x-pack/test/functional/services/ml/stack_management_jobs.ts index be7d6e49537e1..67daafb108868 100644 --- a/x-pack/test/functional/services/ml/stack_management_jobs.ts +++ b/x-pack/test/functional/services/ml/stack_management_jobs.ts @@ -326,8 +326,8 @@ export function MachineLearningStackManagementJobsProvider({ }, async getDownload(filePath: string) { - return retry.tryForTime(60 * 1000, async () => { - expect(fs.existsSync(filePath)).to.be(true); + return retry.tryForTime(5000, async () => { + expect(fs.existsSync(filePath)).to.eql(true, `File path ${filePath} should exist`); return fs.readFileSync(filePath).toString(); }); }, From 2e2d7b72391219249bb7898ab5459a5ce58cac73 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Tue, 28 Feb 2023 16:56:20 +0100 Subject: [PATCH 3/5] Use the correct way to run browser in headless mode --- test/functional/services/remote/webdriver.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/functional/services/remote/webdriver.ts b/test/functional/services/remote/webdriver.ts index af2e1056e6867..f7de7159fc5df 100644 --- a/test/functional/services/remote/webdriver.ts +++ b/test/functional/services/remote/webdriver.ts @@ -99,9 +99,12 @@ function initChromiumOptions(browserType: Browsers, acceptInsecureCerts: boolean } if (headlessBrowser === '1') { + // Using the new headless mode (instead of `options.headless()`) + // See: https://www.selenium.dev/blog/2023/headless-is-going-away/ + options.addArguments('headless=new'); + // Use --disable-gpu to avoid an error from a missing Mesa library, as per // See: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md - options.headless(); options.addArguments('disable-gpu'); } @@ -111,7 +114,10 @@ function initChromiumOptions(browserType: Browsers, acceptInsecureCerts: boolean if (remoteDebug === '1') { // Visit chrome://inspect in chrome to remotely view/debug - options.headless(); + + // Using the new headless mode (instead of `options.headless()`) + // See: https://www.selenium.dev/blog/2023/headless-is-going-away/ + options.addArguments('headless=new'); options.addArguments('disable-gpu', 'remote-debugging-port=9222'); } From 4a448ac798dcf3c95299684bb803c4e8e4298f42 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Tue, 28 Feb 2023 16:57:39 +0100 Subject: [PATCH 4/5] Unskip download CSV tests --- .../apps/dashboard/group3/reporting/download_csv.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/x-pack/test/functional/apps/dashboard/group3/reporting/download_csv.ts b/x-pack/test/functional/apps/dashboard/group3/reporting/download_csv.ts index 3ce3f9a7b9f36..d062eb8feb432 100644 --- a/x-pack/test/functional/apps/dashboard/group3/reporting/download_csv.ts +++ b/x-pack/test/functional/apps/dashboard/group3/reporting/download_csv.ts @@ -67,12 +67,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.existOrFail('csvDownloadStarted'); // validate toast panel }; - // Failing: See https://github.com/elastic/kibana/issues/150561 - // Failing: See https://github.com/elastic/kibana/issues/150562 - // Failing: See https://github.com/elastic/kibana/issues/148314 - // Failing: See https://github.com/elastic/kibana/issues/150563 - // Failing: See https://github.com/elastic/kibana/issues/150561 - describe.skip('Download CSV', () => { + describe('Download CSV', () => { before('initialize tests', async () => { log.debug('ReportingPage:initTests'); await browser.setWindowSize(1600, 850); From 45efba34e414051ffa066b9513cf40aba9d86682 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Fri, 24 Mar 2023 11:05:38 +0100 Subject: [PATCH 5/5] Revert "Use the correct way to run browser in headless mode" This reverts commit 2e2d7b72391219249bb7898ab5459a5ce58cac73. --- test/functional/services/remote/webdriver.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/functional/services/remote/webdriver.ts b/test/functional/services/remote/webdriver.ts index f7de7159fc5df..af2e1056e6867 100644 --- a/test/functional/services/remote/webdriver.ts +++ b/test/functional/services/remote/webdriver.ts @@ -99,12 +99,9 @@ function initChromiumOptions(browserType: Browsers, acceptInsecureCerts: boolean } if (headlessBrowser === '1') { - // Using the new headless mode (instead of `options.headless()`) - // See: https://www.selenium.dev/blog/2023/headless-is-going-away/ - options.addArguments('headless=new'); - // Use --disable-gpu to avoid an error from a missing Mesa library, as per // See: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md + options.headless(); options.addArguments('disable-gpu'); } @@ -114,10 +111,7 @@ function initChromiumOptions(browserType: Browsers, acceptInsecureCerts: boolean if (remoteDebug === '1') { // Visit chrome://inspect in chrome to remotely view/debug - - // Using the new headless mode (instead of `options.headless()`) - // See: https://www.selenium.dev/blog/2023/headless-is-going-away/ - options.addArguments('headless=new'); + options.headless(); options.addArguments('disable-gpu', 'remote-debugging-port=9222'); }