Skip to content

[8.19] [dashboard] avoid 5 second delay in functional tests when calling onDashboardLandingPage (#226064)#226274

Merged
kibanamachine merged 1 commit intoelastic:8.19from
kibanamachine:backport/8.19/pr-226064
Jul 2, 2025
Merged

[8.19] [dashboard] avoid 5 second delay in functional tests when calling onDashboardLandingPage (#226064)#226274
kibanamachine merged 1 commit intoelastic:8.19from
kibanamachine:backport/8.19/pr-226064

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Jul 2, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) July 2, 2025 16:48
…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)
@kibanamachine kibanamachine force-pushed the backport/8.19/pr-226064 branch from 6def422 to 508dfff Compare July 2, 2025 18:38
@kibanamachine kibanamachine merged commit 5bb3bc1 into elastic:8.19 Jul 2, 2025
8 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @nreese

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants