Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[functional-tests] TimePicker optimizations #130200

Merged

Conversation

brianseeders
Copy link
Contributor

@brianseeders brianseeders commented Apr 13, 2022

These optimizations speed up some of the interactions with the timepicker during functional tests. Previously, many common operations had a minimum execution time of 2.5s and are now instant.

These changes cut about 1hr of cumulative execution time off the build, divided up over various test suites. For example, the lens tests in CI Group 3 are now almost 10 minutes faster.

@brianseeders brianseeders added release_note:skip Skip the PR/issue when compiling release notes Feature:CI Continuous integration v8.3.0 labels Apr 13, 2022
@brianseeders brianseeders changed the title Functional test optimizations round 3 [functional-tests] TimePicker optimizations Apr 15, 2022
@brianseeders brianseeders added v8.2.0 auto-backport Deprecated - use backport:version if exact versions are needed Team:Operations Team label for Operations Team labels Apr 15, 2022
@brianseeders brianseeders requested a review from a team April 15, 2022 16:32
@brianseeders brianseeders marked this pull request as ready for review April 15, 2022 16:32
@brianseeders brianseeders requested a review from a team as a code owner April 15, 2022 16:32
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

Copy link

@LeeDr LeeDr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few questions but I don't want to hold up any change that speeds up tests (and doesn't cause flakiness).

Something I've done in a few places to speed up checks is to get a parent element which we know will always be there, and then check either the innerHTML or the other classes of the element to see if it's open or not. That makes it fast in both cases where the element is or isn't there.

await this.retryCall(async function click(wrapper) {
await wrapper.scrollIntoViewIfNecessary(topOffset);
await wrapper._webElement.click();
}, retries);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what type of failures this will detect and retry for? A click can fail because of a stale element, but retrying won't fix that. There's no code to detect if the desired action from the click actually happened. Maybe if the element was initially disabled, a retry could click again when it's enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually wrote this a while ago, but I believe the main case was an element that was hidden or obscured by another element. For example, if a toast notification pops up in front of the element and you try to click it, I believe you get an error saying that another element would receive the click.

timeout: 50,
});
if (isShowDatesButton) {
await this.testSubjects.clickWithRetries('superDatePickerShowDatesButton', 0, 50);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like zero retries? I don't see retries actually being used but I might be missing it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, in the Lens test I ran, in the output I see the test looking for superDatePickerShowDatesButton and not finding it. I've opened and closed the quick pick (superDatePickerToggleQuickMenuButton) and the start date popover (superDatePickerstartDatePopoverButton) and searched the dom elements and never find it. Maybe it's used on another page.

[15:12:37.302824000] │ debg TestSubjects.exists(superDatePickerShowDatesButton)
[15:12:37.307540000] │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerShowDatesButton"]') with timeout=50
[15:12:37.350293000] │ debg --- retry.tryForTime error: [data-test-subj="superDatePickerShowDatesButton"] is not displayed

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@brianseeders
Copy link
Contributor Author

@LeeDr could you take a look again? I originally split this out from some past work, and didn't realize more of it could be taken out.

Copy link

@LeeDr LeeDr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Code and CI results review

@brianseeders brianseeders merged commit fb87699 into elastic:main Apr 18, 2022
@brianseeders brianseeders deleted the functional-test-optimizations-3 branch April 18, 2022 20:13
kibanamachine pushed a commit that referenced this pull request Apr 18, 2022
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.2

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Apr 18, 2022
(cherry picked from commit fb87699)

Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Apr 19, 2022
…disable-server-side

* 'main' of github.com:elastic/kibana: (103 commits)
  [Osquery] Update eslint config (elastic#129637)
  [Uptime] Update monitor saved object mappings (elastic#130433)
  Add links to metricbeat module docs (elastic#130519)
  Add link to troubleshooting guide in confirm data copy (elastic#130420)
  [Step 3] Cleanup charts plugin (elastic#130132)
  [Visualize] Adds a deprecation warning to the pie app (elastic#130447)
  [Maps] fix vector tile load errors not displayed in legend (elastic#130395)
  [CI] Split alerting-api-integration tests into separate cigroups (elastic#130414)
  [CI] Use spot instances for default cigroups in PR CI (elastic#130476)
  [functional-tests] TimePicker optimizations (elastic#130200)
  [kbn/pm] use stable module ids in dist (elastic#130497)
  [8.2.1][Security Solution][Session view] fix full screen session view margin (elastic#130496)
  Fix wrong config in comments (elastic#130378)
  Add deprecated telemetry (elastic#130458)
  Add eslint rule to support breaking up packages (elastic#130483)
  [Security Solution][Endpoint] Fix test stability and un-skip flaky tests (elastic#130176)
  Update object types for SharePoint Online external connector (elastic#130478)
  [Workplace Search] Fix broken feedback link (elastic#130475)
  Rename the term "execution" in config to "run" (elastic#130172)
  [Cloud Posture] use index with keyword mapping (elastic#130456)
  ...

# Conflicts:
#	docs/user/reporting/index.asciidoc
#	x-pack/plugins/reporting/public/types.ts
#	x-pack/plugins/screenshotting/server/screenshots/index.test.ts
#	x-pack/plugins/screenshotting/server/screenshots/index.ts
kertal pushed a commit to kertal/kibana that referenced this pull request May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:CI Continuous integration release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v8.2.0 v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants