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

[Dashboard] Fix flaky sync_colors.tsx test #172633

Merged

Conversation

Heenawter
Copy link
Contributor

@Heenawter Heenawter commented Dec 5, 2023

Closes #148557

Summary

It is possible for the noDataPopover to take more than the 100ms timeout from ensureHiddenNoDataPopover (pictured below) to appear - in these cases, any tests that make use of the Lens page object's goToTimeRange method will fail due to clicking the wrong element (the tour step rather than the time picker).

image

While my initial thought was to simply increase the timeout for the noDataPopover check, this isn't ideal - a lot of tests use the goToTimeRange method and, by doing this, we would be slowing down every single one of them even when the test wouldn't have failed to begin with! Instead, I've chosen to surround the important parts of the code in goToTimeRange with a retry - that way, if the noDataPopover never shows up or it shows up comfortably within the 100ms timeout, the impact to the speed of a given test will be minimal; however, if the no data popover shows up outside of this timeout, the retry will save the test from outright failure.

Flaky Test Runner

image

Checklist

For maintainers

@Heenawter Heenawter added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:small Small Level of Effort release_note:skip Skip the PR/issue when compiling release notes impact:critical This issue should be addressed immediately due to a critical level of impact on the product. labels Dec 5, 2023
@Heenawter Heenawter self-assigned this Dec 5, 2023
@Heenawter Heenawter force-pushed the fix-flaky-sync-colors-148557_2023-12-05 branch from 6499b07 to 03e3499 Compare December 5, 2023 22:38
@Heenawter Heenawter added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.13.0 labels Dec 5, 2023
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

  • 💔 Build #182006 failed f0611fb26a16056ef7dded40e0be5de44b339a30
  • 💔 Build #181987 failed 019dac840e847dcaee799e6c06a922547da9b9da

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

cc @Heenawter

@Heenawter Heenawter marked this pull request as ready for review December 5, 2023 23:51
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

Copy link
Contributor

@nreese nreese 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 review only.

@Heenawter Heenawter merged commit d9e2d06 into elastic:main Dec 6, 2023
39 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 6, 2023
## Summary

It is possible for the `noDataPopover` to take more than the `100ms`
timeout from `ensureHiddenNoDataPopover` (pictured below) to appear - in
these cases, any tests that make use of the Lens page object's
`goToTimeRange` method will fail due to clicking the wrong element (the
tour step rather than the time picker).

![image](https://github.com/elastic/kibana/assets/8698078/35de1215-6f9f-4a72-a0ab-e1a60f5bb80a)

While my initial thought was to simply increase the timeout for the
`noDataPopover` check, this isn't ideal - **a lot** of tests use the
`goToTimeRange` method and, by doing this, we would be slowing down
**every single one of them** even when the test wouldn't have failed to
begin with! Instead, I've chosen to surround the important parts of the
code in `goToTimeRange` with a `retry` - that way, if the
`noDataPopover` never shows up or it shows up comfortably within the
`100ms` timeout, the impact to the speed of a given test will be
**minimal**; however, if the no data popover shows up **outside** of
this timeout, the retry will save the test from outright failure.

### [Flaky Test
Runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4192)

![image](https://github.com/elastic/kibana/assets/8698078/1ac033d7-6cc1-4789-9a2b-6c7b8c34f67c)

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit d9e2d06)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.11
8.13 The branch "8.13" does not exist

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 172633

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 6, 2023
# Backport

This will backport the following commits from `main` to `8.11`:
- [[Dashboard] Fix flaky `sync_colors.tsx` test
(#172633)](#172633)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-06T14:55:13Z","message":"[Dashboard]
Fix flaky `sync_colors.tsx` test (#172633)\n\n## Summary\r\n\r\nIt is
possible for the `noDataPopover` to take more than the
`100ms`\r\ntimeout from `ensureHiddenNoDataPopover` (pictured below) to
appear - in\r\nthese cases, any tests that make use of the Lens page
object's\r\n`goToTimeRange` method will fail due to clicking the wrong
element (the\r\ntour step rather than the time
picker).\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/35de1215-6f9f-4a72-a0ab-e1a60f5bb80a)\r\n\r\n\r\nWhile
my initial thought was to simply increase the timeout for
the\r\n`noDataPopover` check, this isn't ideal - **a lot** of tests use
the\r\n`goToTimeRange` method and, by doing this, we would be slowing
down\r\n**every single one of them** even when the test wouldn't have
failed to\r\nbegin with! Instead, I've chosen to surround the important
parts of the\r\ncode in `goToTimeRange` with a `retry` - that way, if
the\r\n`noDataPopover` never shows up or it shows up comfortably within
the\r\n`100ms` timeout, the impact to the speed of a given test will
be\r\n**minimal**; however, if the no data popover shows up **outside**
of\r\nthis timeout, the retry will save the test from outright
failure.\r\n\r\n### [Flaky
Test\r\nRunner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4192)\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/1ac033d7-6cc1-4789-9a2b-6c7b8c34f67c)\r\n\r\n\r\n###
Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"d9e2d06512196ff6800a8441fc4605c258f206dd","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","loe:small","release_note:skip","impact:critical","backport:prev-minor","v8.12.0","v8.13.0"],"number":172633,"url":"https://github.com/elastic/kibana/pull/172633","mergeCommit":{"message":"[Dashboard]
Fix flaky `sync_colors.tsx` test (#172633)\n\n## Summary\r\n\r\nIt is
possible for the `noDataPopover` to take more than the
`100ms`\r\ntimeout from `ensureHiddenNoDataPopover` (pictured below) to
appear - in\r\nthese cases, any tests that make use of the Lens page
object's\r\n`goToTimeRange` method will fail due to clicking the wrong
element (the\r\ntour step rather than the time
picker).\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/35de1215-6f9f-4a72-a0ab-e1a60f5bb80a)\r\n\r\n\r\nWhile
my initial thought was to simply increase the timeout for
the\r\n`noDataPopover` check, this isn't ideal - **a lot** of tests use
the\r\n`goToTimeRange` method and, by doing this, we would be slowing
down\r\n**every single one of them** even when the test wouldn't have
failed to\r\nbegin with! Instead, I've chosen to surround the important
parts of the\r\ncode in `goToTimeRange` with a `retry` - that way, if
the\r\n`noDataPopover` never shows up or it shows up comfortably within
the\r\n`100ms` timeout, the impact to the speed of a given test will
be\r\n**minimal**; however, if the no data popover shows up **outside**
of\r\nthis timeout, the retry will save the test from outright
failure.\r\n\r\n### [Flaky
Test\r\nRunner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4192)\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/1ac033d7-6cc1-4789-9a2b-6c7b8c34f67c)\r\n\r\n\r\n###
Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"d9e2d06512196ff6800a8441fc4605c258f206dd"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172633","number":172633,"mergeCommit":{"message":"[Dashboard]
Fix flaky `sync_colors.tsx` test (#172633)\n\n## Summary\r\n\r\nIt is
possible for the `noDataPopover` to take more than the
`100ms`\r\ntimeout from `ensureHiddenNoDataPopover` (pictured below) to
appear - in\r\nthese cases, any tests that make use of the Lens page
object's\r\n`goToTimeRange` method will fail due to clicking the wrong
element (the\r\ntour step rather than the time
picker).\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/35de1215-6f9f-4a72-a0ab-e1a60f5bb80a)\r\n\r\n\r\nWhile
my initial thought was to simply increase the timeout for
the\r\n`noDataPopover` check, this isn't ideal - **a lot** of tests use
the\r\n`goToTimeRange` method and, by doing this, we would be slowing
down\r\n**every single one of them** even when the test wouldn't have
failed to\r\nbegin with! Instead, I've chosen to surround the important
parts of the\r\ncode in `goToTimeRange` with a `retry` - that way, if
the\r\n`noDataPopover` never shows up or it shows up comfortably within
the\r\n`100ms` timeout, the impact to the speed of a given test will
be\r\n**minimal**; however, if the no data popover shows up **outside**
of\r\nthis timeout, the retry will save the test from outright
failure.\r\n\r\n### [Flaky
Test\r\nRunner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4192)\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/1ac033d7-6cc1-4789-9a2b-6c7b8c34f67c)\r\n\r\n\r\n###
Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"d9e2d06512196ff6800a8441fc4605c258f206dd"}},{"branch":"8.13","label":"v8.13.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Hannah Mudge <[email protected]>
@mistic
Copy link
Member

mistic commented Dec 7, 2023

This PR didn't make it on time for the latest 8.11.2 BC. Updating the labels.

@mistic mistic added v8.11.3 and removed v8.11.2 labels Dec 7, 2023
Heenawter added a commit that referenced this pull request Dec 20, 2023
Closes #148557

## Summary

[Ran the
FTR](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4636)
on the skipped test suite and it passed 100 times... Really unclear on
why it keeps failing, especially after
#172633. For now, since I can't
get it to fail locally or with the FTR, I'm going to unskip. If it
starts to fail on `main` again, we could loop in the Vis team to help
(since it's the timepicker in the Lens app that is misbehaving) - but
hopefully the previous failure was a fluke and that won't be necessary🤞

### Checklist

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
([Link](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4636))
![Screenshot 2023-12-20 at 7 47
58 AM](https://github.com/elastic/kibana/assets/8698078/523e715a-a347-4c82-955c-b18cabe53566)


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) impact:critical This issue should be addressed immediately due to a critical level of impact on the product. loe:small Small Level of Effort release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.11.3 v8.12.0 v8.13.0
Projects
None yet
6 participants