Skip to content

[Security Solution] [Detections] Fixes flakey exceptions read-only viewer cypress test#162839

Merged
dhurley14 merged 24 commits intoelastic:mainfrom
dhurley14:flakey-exceptions-test-fix
Aug 12, 2023
Merged

[Security Solution] [Detections] Fixes flakey exceptions read-only viewer cypress test#162839
dhurley14 merged 24 commits intoelastic:mainfrom
dhurley14:flakey-exceptions-test-fix

Conversation

@dhurley14
Copy link
Copy Markdown
Contributor

@dhurley14 dhurley14 commented Jul 31, 2023

Summary

Ref: #162569

The test was trying to load the exceptions tab before the rule details page loaded. Now we wait for the rule tab to load before continuing. Something I was unaware of was that cy.url() will automatically retry until all chained assertions have passed, which I think can be an easy way to fix future flake issues where cypress tries to click on an element before the new page loads.

@dhurley14 dhurley14 self-assigned this Aug 8, 2023
@dhurley14 dhurley14 added review release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area v8.10.0 v8.9.2 labels Aug 11, 2023
@dhurley14 dhurley14 marked this pull request as ready for review August 11, 2023 19:19
@dhurley14 dhurley14 requested a review from a team as a code owner August 11, 2023 19:19
@dhurley14 dhurley14 requested a review from a team as a code owner August 11, 2023 19:19
@dhurley14 dhurley14 enabled auto-merge (squash) August 11, 2023 21:02
@dhurley14 dhurley14 changed the title for flake [Security Solution] [Detections] Fixes flakey exceptions read-only viewer cypress test Aug 11, 2023
@dhurley14 dhurley14 disabled auto-merge August 11, 2023 21:03
@dhurley14 dhurley14 enabled auto-merge (squash) August 11, 2023 21:03

export const goToRuleDetails = () => {
cy.get(RULE_NAME).first().click();
cy.get(RULE_NAME).first().click({ force: true });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: do we have to have this force: true here? I think we're moving towards trying to get rid of use of this in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah we probably do not need the force true. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed here: 2515470 (#162839)

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

cc @dhurley14

@dhurley14 dhurley14 merged commit 7b3cc8f into elastic:main Aug 12, 2023
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.9 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 162839

Questions ?

Please refer to the Backport tool documentation

@dhurley14
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
8.9

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

Questions ?

Please refer to the Backport tool documentation

dhurley14 added a commit to dhurley14/kibana that referenced this pull request Aug 12, 2023
…ewer cypress test (elastic#162839)

## Summary

Ref: elastic#162569

The test was trying to load the exceptions tab before the rule details
page loaded. Now we wait for the rule tab to load before continuing.
Something I was unaware of was that `cy.url()` will [automatically
retry](https://docs.cypress.io/api/commands/url#Assertions) until all
chained assertions have passed, which I think can be an easy way to fix
future flake issues where cypress tries to click on an element before
the new page loads.

(cherry picked from commit 7b3cc8f)

# Conflicts:
#	x-pack/plugins/security_solution/cypress/e2e/exceptions/rule_details_flow/read_only_view.cy.ts
dhurley14 added a commit that referenced this pull request Aug 12, 2023
…nly viewer cypress test (#162839) (#163766)

# Backport

This will backport the following commits from `main` to `8.9`:
- [[Security Solution] [Detections] Fixes flakey exceptions read-only
viewer cypress test
(#162839)](#162839)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Devin W.
Hurley","email":"devin.hurley@elastic.co"},"sourceCommit":{"committedDate":"2023-08-12T03:35:20Z","message":"[Security
Solution] [Detections] Fixes flakey exceptions read-only viewer cypress
test (#162839)\n\n## Summary\r\n\r\nRef:
https://github.com/elastic/kibana/issues/162569\r\n\r\nThe test was
trying to load the exceptions tab before the rule details\r\npage
loaded. Now we wait for the rule tab to load before
continuing.\r\nSomething I was unaware of was that `cy.url()` will
[automatically\r\nretry](https://docs.cypress.io/api/commands/url#Assertions)
until all\r\nchained assertions have passed, which I think can be an
easy way to fix\r\nfuture flake issues where cypress tries to click on
an element before\r\nthe new page
loads.","sha":"7b3cc8f5735306d13113b0f75499f386fc0aec48","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["review","release_note:skip","Team:Detection
Engine","v8.10.0","v8.9.2"],"number":162839,"url":"https://github.com/elastic/kibana/pull/162839","mergeCommit":{"message":"[Security
Solution] [Detections] Fixes flakey exceptions read-only viewer cypress
test (#162839)\n\n## Summary\r\n\r\nRef:
https://github.com/elastic/kibana/issues/162569\r\n\r\nThe test was
trying to load the exceptions tab before the rule details\r\npage
loaded. Now we wait for the rule tab to load before
continuing.\r\nSomething I was unaware of was that `cy.url()` will
[automatically\r\nretry](https://docs.cypress.io/api/commands/url#Assertions)
until all\r\nchained assertions have passed, which I think can be an
easy way to fix\r\nfuture flake issues where cypress tries to click on
an element before\r\nthe new page
loads.","sha":"7b3cc8f5735306d13113b0f75499f386fc0aec48"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/162839","number":162839,"mergeCommit":{"message":"[Security
Solution] [Detections] Fixes flakey exceptions read-only viewer cypress
test (#162839)\n\n## Summary\r\n\r\nRef:
https://github.com/elastic/kibana/issues/162569\r\n\r\nThe test was
trying to load the exceptions tab before the rule details\r\npage
loaded. Now we wait for the rule tab to load before
continuing.\r\nSomething I was unaware of was that `cy.url()` will
[automatically\r\nretry](https://docs.cypress.io/api/commands/url#Assertions)
until all\r\nchained assertions have passed, which I think can be an
easy way to fix\r\nfuture flake issues where cypress tries to click on
an element before\r\nthe new page
loads.","sha":"7b3cc8f5735306d13113b0f75499f386fc0aec48"}},{"branch":"8.9","label":"v8.9.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
jughosta pushed a commit to jughosta/kibana that referenced this pull request Aug 14, 2023
…ewer cypress test (elastic#162839)

## Summary

Ref: elastic#162569

The test was trying to load the exceptions tab before the rule details
page loaded. Now we wait for the rule tab to load before continuing.
Something I was unaware of was that `cy.url()` will [automatically
retry](https://docs.cypress.io/api/commands/url#Assertions) until all
chained assertions have passed, which I think can be an easy way to fix
future flake issues where cypress tries to click on an element before
the new page loads.
@mistic mistic removed the v8.9.1 label Aug 17, 2023
@mistic
Copy link
Copy Markdown
Contributor

mistic commented Aug 17, 2023

This pr didn't make it into the build candidate for v8.9.1. Updating the labels.

e40pud added a commit to e40pud/kibana that referenced this pull request Aug 21, 2023
e40pud added a commit that referenced this pull request Aug 21, 2023
…ewer cypress test (#164283)

## Summary

Fixes: #162569
Fixes: #164061
Fixes: #164058
Fixes: #163546
Fixes: #162669

We tried to fix the issue with this PR
#162839 but test failed again.

This is another attempt to fix it using the @jpdjere's approach where we
disable rule's table refreshing
(#163698).
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 21, 2023
…ewer cypress test (elastic#164283)

## Summary

Fixes: elastic#162569
Fixes: elastic#164061
Fixes: elastic#164058
Fixes: elastic#163546
Fixes: elastic#162669

We tried to fix the issue with this PR
elastic#162839 but test failed again.

This is another attempt to fix it using the @jpdjere's approach where we
disable rule's table refreshing
(elastic#163698).

(cherry picked from commit 4477f64)
kibanamachine added a commit that referenced this pull request Aug 21, 2023
…only viewer cypress test (#164283) (#164346)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[Security Solution] [Detections] Fixes flakey exceptions read-only
viewer cypress test
(#164283)](#164283)

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

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

<!--BACKPORT [{"author":{"name":"Ievgen
Sorokopud","email":"ievgen.sorokopud@elastic.co"},"sourceCommit":{"committedDate":"2023-08-21T18:40:14Z","message":"[Security
Solution] [Detections] Fixes flakey exceptions read-only viewer cypress
test (#164283)\n\n## Summary\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/162569\r\nFixes:
https://github.com/elastic/kibana/issues/164061\r\nFixes:
https://github.com/elastic/kibana/issues/164058\r\nFixes:
https://github.com/elastic/kibana/issues/163546\r\nFixes:
https://github.com/elastic/kibana/issues/162669\r\n\r\nWe tried to fix
the issue with this PR\r\nhttps://github.com//pull/162839
but test failed again.\r\n\r\nThis is another attempt to fix it using
the @jpdjere's approach where we\r\ndisable rule's table
refreshing\r\n(https://github.com/elastic/kibana/pull/163698).","sha":"4477f642e3297355ef676dcf485efb0cb49c4fcb","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:
SecuritySolution","Team:Detection
Engine","v8.10.0","v8.11.0"],"number":164283,"url":"https://github.com/elastic/kibana/pull/164283","mergeCommit":{"message":"[Security
Solution] [Detections] Fixes flakey exceptions read-only viewer cypress
test (#164283)\n\n## Summary\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/162569\r\nFixes:
https://github.com/elastic/kibana/issues/164061\r\nFixes:
https://github.com/elastic/kibana/issues/164058\r\nFixes:
https://github.com/elastic/kibana/issues/163546\r\nFixes:
https://github.com/elastic/kibana/issues/162669\r\n\r\nWe tried to fix
the issue with this PR\r\nhttps://github.com//pull/162839
but test failed again.\r\n\r\nThis is another attempt to fix it using
the @jpdjere's approach where we\r\ndisable rule's table
refreshing\r\n(https://github.com/elastic/kibana/pull/163698).","sha":"4477f642e3297355ef676dcf485efb0cb49c4fcb"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164283","number":164283,"mergeCommit":{"message":"[Security
Solution] [Detections] Fixes flakey exceptions read-only viewer cypress
test (#164283)\n\n## Summary\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/162569\r\nFixes:
https://github.com/elastic/kibana/issues/164061\r\nFixes:
https://github.com/elastic/kibana/issues/164058\r\nFixes:
https://github.com/elastic/kibana/issues/163546\r\nFixes:
https://github.com/elastic/kibana/issues/162669\r\n\r\nWe tried to fix
the issue with this PR\r\nhttps://github.com//pull/162839
but test failed again.\r\n\r\nThis is another attempt to fix it using
the @jpdjere's approach where we\r\ndisable rule's table
refreshing\r\n(https://github.com/elastic/kibana/pull/163698).","sha":"4477f642e3297355ef676dcf485efb0cb49c4fcb"}}]}]
BACKPORT-->

Co-authored-by: Ievgen Sorokopud <ievgen.sorokopud@elastic.co>
e40pud added a commit to e40pud/kibana that referenced this pull request Aug 21, 2023
…ewer cypress test (elastic#164283)

## Summary

Fixes: elastic#162569
Fixes: elastic#164061
Fixes: elastic#164058
Fixes: elastic#163546
Fixes: elastic#162669

We tried to fix the issue with this PR
elastic#162839 but test failed again.

This is another attempt to fix it using the @jpdjere's approach where we
disable rule's table refreshing
(elastic#163698).

(cherry picked from commit 4477f64)
e40pud added a commit that referenced this pull request Aug 22, 2023
…nly viewer cypress test (#164283) (#164352)

# Backport

This will backport the following commits from `main` to `8.9`:
- [[Security Solution] [Detections] Fixes flakey exceptions read-only
viewer cypress test
(#164283)](#164283)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Ievgen
Sorokopud","email":"ievgen.sorokopud@elastic.co"},"sourceCommit":{"committedDate":"2023-08-21T18:40:14Z","message":"[Security
Solution] [Detections] Fixes flakey exceptions read-only viewer cypress
test (#164283)\n\n## Summary\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/162569\r\nFixes:
https://github.com/elastic/kibana/issues/164061\r\nFixes:
https://github.com/elastic/kibana/issues/164058\r\nFixes:
https://github.com/elastic/kibana/issues/163546\r\nFixes:
https://github.com/elastic/kibana/issues/162669\r\n\r\nWe tried to fix
the issue with this PR\r\nhttps://github.com//pull/162839
but test failed again.\r\n\r\nThis is another attempt to fix it using
the @jpdjere's approach where we\r\ndisable rule's table
refreshing\r\n(https://github.com/elastic/kibana/pull/163698).","sha":"4477f642e3297355ef676dcf485efb0cb49c4fcb","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:
SecuritySolution","Team:Detection
Engine","v8.10.0","v8.11.0"],"number":164283,"url":"https://github.com/elastic/kibana/pull/164283","mergeCommit":{"message":"[Security
Solution] [Detections] Fixes flakey exceptions read-only viewer cypress
test (#164283)\n\n## Summary\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/162569\r\nFixes:
https://github.com/elastic/kibana/issues/164061\r\nFixes:
https://github.com/elastic/kibana/issues/164058\r\nFixes:
https://github.com/elastic/kibana/issues/163546\r\nFixes:
https://github.com/elastic/kibana/issues/162669\r\n\r\nWe tried to fix
the issue with this PR\r\nhttps://github.com//pull/162839
but test failed again.\r\n\r\nThis is another attempt to fix it using
the @jpdjere's approach where we\r\ndisable rule's table
refreshing\r\n(https://github.com/elastic/kibana/pull/163698).","sha":"4477f642e3297355ef676dcf485efb0cb49c4fcb"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/164346","number":164346,"state":"MERGED","mergeCommit":{"sha":"bdbc3e7e0e7cf59397af3653ed2f8ba86bd3ea93","message":"[8.10]
[Security Solution] [Detections] Fixes flakey exceptions read-only
viewer cypress test (#164283) (#164346)\n\n# Backport\n\nThis will
backport the following commits from `main` to `8.10`:\n- [[Security
Solution] [Detections] Fixes flakey exceptions read-only\nviewer cypress
test\n(#164283)](https://github.com/elastic/kibana/pull/164283)\n\n<!---
Backport version: 8.9.7 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Ievgen\nSorokopud\",\"email\":\"ievgen.sorokopud@elastic.co\"},\"sourceCommit\":{\"committedDate\":\"2023-08-21T18:40:14Z\",\"message\":\"[Security\nSolution]
[Detections] Fixes flakey exceptions read-only viewer cypress\ntest
(#164283)\\n\\n##
Summary\\r\\n\\r\\nFixes:\nhttps://github.com//issues/162569\\r\\nFixes:\nhttps://github.com//issues/164061\\r\\nFixes:\nhttps://github.com//issues/164058\\r\\nFixes:\nhttps://github.com//issues/163546\\r\\nFixes:\nhttps://github.com//issues/162669\\r\\n\\r\\nWe
tried to fix\nthe issue with this
PR\\r\\nhttps://github.com//pull/162839\nbut test failed
again.\\r\\n\\r\\nThis is another attempt to fix it using\nthe
@jpdjere's approach where we\\r\\ndisable rule's
table\nrefreshing\\r\\n(https://github.com/elastic/kibana/pull/163698).\",\"sha\":\"4477f642e3297355ef676dcf485efb0cb49c4fcb\",\"branchLabelMapping\":{\"^v8.11.0$\":\"main\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:skip\",\"Team:\nSecuritySolution\",\"Team:Detection\nEngine\",\"v8.10.0\",\"v8.11.0\"],\"number\":164283,\"url\":\"https://github.com/elastic/kibana/pull/164283\",\"mergeCommit\":{\"message\":\"[Security\nSolution]
[Detections] Fixes flakey exceptions read-only viewer cypress\ntest
(#164283)\\n\\n##
Summary\\r\\n\\r\\nFixes:\nhttps://github.com//issues/162569\\r\\nFixes:\nhttps://github.com//issues/164061\\r\\nFixes:\nhttps://github.com//issues/164058\\r\\nFixes:\nhttps://github.com//issues/163546\\r\\nFixes:\nhttps://github.com//issues/162669\\r\\n\\r\\nWe
tried to fix\nthe issue with this
PR\\r\\nhttps://github.com//pull/162839\nbut test failed
again.\\r\\n\\r\\nThis is another attempt to fix it using\nthe
@jpdjere's approach where we\\r\\ndisable rule's
table\nrefreshing\\r\\n(https://github.com/elastic/kibana/pull/163698).\",\"sha\":\"4477f642e3297355ef676dcf485efb0cb49c4fcb\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.10\"],\"targetPullRequestStates\":[{\"branch\":\"8.10\",\"label\":\"v8.10.0\",\"labelRegex\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"main\",\"label\":\"v8.11.0\",\"labelRegex\":\"^v8.11.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/164283\",\"number\":164283,\"mergeCommit\":{\"message\":\"[Security\nSolution]
[Detections] Fixes flakey exceptions read-only viewer cypress\ntest
(#164283)\\n\\n##
Summary\\r\\n\\r\\nFixes:\nhttps://github.com//issues/162569\\r\\nFixes:\nhttps://github.com//issues/164061\\r\\nFixes:\nhttps://github.com//issues/164058\\r\\nFixes:\nhttps://github.com//issues/163546\\r\\nFixes:\nhttps://github.com//issues/162669\\r\\n\\r\\nWe
tried to fix\nthe issue with this
PR\\r\\nhttps://github.com//pull/162839\nbut test failed
again.\\r\\n\\r\\nThis is another attempt to fix it using\nthe
@jpdjere's approach where we\\r\\ndisable rule's
table\nrefreshing\\r\\n(https://github.com/elastic/kibana/pull/163698).\",\"sha\":\"4477f642e3297355ef676dcf485efb0cb49c4fcb\"}}]}]\nBACKPORT-->\n\nCo-authored-by:
Ievgen Sorokopud
<ievgen.sorokopud@elastic.co>"}},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164283","number":164283,"mergeCommit":{"message":"[Security
Solution] [Detections] Fixes flakey exceptions read-only viewer cypress
test (#164283)\n\n## Summary\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/162569\r\nFixes:
https://github.com/elastic/kibana/issues/164061\r\nFixes:
https://github.com/elastic/kibana/issues/164058\r\nFixes:
https://github.com/elastic/kibana/issues/163546\r\nFixes:
https://github.com/elastic/kibana/issues/162669\r\n\r\nWe tried to fix
the issue with this PR\r\nhttps://github.com//pull/162839
but test failed again.\r\n\r\nThis is another attempt to fix it using
the @jpdjere's approach where we\r\ndisable rule's table
refreshing\r\n(https://github.com/elastic/kibana/pull/163698).","sha":"4477f642e3297355ef676dcf485efb0cb49c4fcb"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes review Team:Detection Engine Security Solution Detection Engine Area v8.9.2 v8.10.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants