[9.1] [dashboard] avoid 5 second delay in functional tests when calling onDashboardLandingPage (#226064)#226276
Merged
kibanamachine merged 1 commit intoelastic:9.1from Jul 2, 2025
Conversation
…ashboardLandingPage (elastic#226064) The current implementation of `onDashboardLandingPage` calls `this.listingTable.onListingPage('dashboard')`. `onListingPage` is inlined below for reference. The problem with this implementation is that when the test is not on the listing page, there is a 5000 milliseconds delay checking for the existence of a never-gonna-be-there element. ``` public async onListingPage(appName: AppName) { return await this.testSubjects.exists(`${appName}LandingPage`, { timeout: 5000, }); } ``` `onDashboardLandingPage` is used 20 times, while `onDashboardLandingPage` is called in `gotoDashboardLandingPage`, which is used 137 times. A majority of these calls occur when the test is on `dashboards#/view` so the tests delay 5 seconds on these calls. Needless to say, our tests waste a lot of time determining if they are on the listing page. One case study is src/platform/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts, which calls `gotoDashboardLandingPage` 11 times. Before this change, this test takes 4 minutes to run. With this change, this test takes 3 minutes to run which lines up with our expection that 11 x 5 seconds is about one minute. The PR resolves the issue by checking the URL instead of the DOM. This way, the test instantly knows if its on the landing page without any delays. Flaky test runner https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8504. Ran src/platform/test/functional/apps/dashboard/group1/config.ts, which includes dashboard_unsaved_listing.ts, to ensure this change is not flaky. I also ran the flaky test runner https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8506 as a control to see how long it takes without these changes. The runs where 2 to 3 minutes faster with the changes. Control - no changes to `onDashboardLandingPage` <img width="408" alt="Screenshot 2025-07-01 at 4 45 04 PM" src="https://github.com/user-attachments/assets/58acc42c-241c-4005-b564-c114ff6b7b15" /> With changes to `onDashboardLandingPage` <img width="348" alt="Screenshot 2025-07-01 at 4 45 44 PM" src="https://github.com/user-attachments/assets/45ed8cde-e78c-4be6-a6b4-e9d95626a681" /> (cherry picked from commit 0a761c9)
40eca65 to
dbe6b28
Compare
Contributor
💚 Build Succeeded
Metrics [docs]
cc @nreese |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.1:Questions ?
Please refer to the Backport tool documentation