From faa325be6bf25985c04f6c65f10b84d905d70f29 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Sat, 22 Mar 2025 19:31:54 +0100 Subject: [PATCH] [scout] Remove perf stats validation for Discover (#215130) ## Summary With #212397 we added 2 tests for Discover app (loading `/app/discover`) to track: - js bundles loaded on page - perf metrics like CPU time, Layout time and Script time fetched with CDP Performance Domain API While the first test for bundles _didn't report any failures_, second test to validate Perf metrics fails periodically: https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs/builds/34729#0195a4de-6cd5-4d1e-be11-5d02be6de2b0 ``` Error: CPU time (seconds) usage during page navigation should not exceed 1.5 seconds expect(received).toBeLessThan(expected) Expected: < 1.5 Received: 1.591343 ``` https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs/builds/34877 ``` Error: Additional time spent executing JS scripts should not exceed 0.5 second expect(received).toBeLessThan(expected) Expected: < 0.5 Received: 0.601434 ``` https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs/builds/34899 ``` Error: Total layout computation time should not exceed 0.06 second expect(received).toBeLessThan(expected) Expected: < 0.06 Received: 0.061723 ``` https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs/builds/34912#0195adb8-4536-42b7-ab4d-524535fdad9a ``` Error: Additional time spent executing JS scripts should not exceed 0.5 second expect(received).toBeLessThan(expected) Expected: < 0.5 Received: 0.561259 ``` It was worth an experiment, but due to flakiness we decided to keep only bundles limits validation for now and see if it is stable in the long run. If Data-Discovery team has interest in collecting Perf metrics without strict validation in PRs, we can discuss the options. Alternatively we can wait for Scout GA and you can deep dive into your own performance testing with Playwright/CDP. (cherry picked from commit 4dc27ba4aaa5bbc0a18a1964f58f2f63e2ccde16) # Conflicts: # x-pack/platform/plugins/private/discover_enhanced/ui_tests/tests/discover_cdp_perf.spec.ts --- .../ui_tests/tests/discover_cdp_perf.spec.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/x-pack/platform/plugins/private/discover_enhanced/ui_tests/tests/discover_cdp_perf.spec.ts b/x-pack/platform/plugins/private/discover_enhanced/ui_tests/tests/discover_cdp_perf.spec.ts index deb041b9b794b..e03d1c74e587d 100644 --- a/x-pack/platform/plugins/private/discover_enhanced/ui_tests/tests/discover_cdp_perf.spec.ts +++ b/x-pack/platform/plugins/private/discover_enhanced/ui_tests/tests/discover_cdp_perf.spec.ts @@ -95,6 +95,7 @@ test.describe( page, pageObjects, perfTracker, + log, }) => { const beforeMetrics = await perfTracker.capturePagePerformanceMetrics(cdp); @@ -113,18 +114,7 @@ test.describe( afterMetrics ); - expect( - perfStats.cpuTime.diff, - 'CPU time (seconds) usage during page navigation should not exceed 1.5 seconds' - ).toBeLessThan(1.5); - expect( - perfStats.scriptTime.diff, - 'Additional time spent executing JS scripts should not exceed 0.5 second' - ).toBeLessThan(0.5); - expect( - perfStats.layoutTime.diff, - 'Total layout computation time should not exceed 0.1 second' - ).toBeLessThan(0.06); + log.info(`Performance Metrics for Discover app: ${JSON.stringify(perfStats, null, 2)}`); }); } );