-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[SecuritySolution] Fix flaky timeline creation tests (role-based issues) #173413
[SecuritySolution] Fix flaky timeline creation tests (role-based issues) #173413
Conversation
- removes the unnecessary `context` calls - updates the test titles to use the `should` convention
/ci |
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
/ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great overall, left a few comments or potential improvements
x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/creation.cy.ts
Show resolved
Hide resolved
x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/creation.cy.ts
Outdated
Show resolved
Hide resolved
x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/creation.cy.ts
Show resolved
Hide resolved
x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/creation.cy.ts
Show resolved
Hide resolved
@@ -126,7 +115,8 @@ describe.skip('Timelines', { tags: ['@ess', '@serverless'] }, (): void => { | |||
.should('have.text', getTimeline().notes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the addNotesToTimeline
implementation something is a bit fishy:
- first the
goToNotesTab
returns acy.get
but nothing is using that so it could be removed - second is at the end of the implementation we navigate to the query tab (
goToQueryTab
) then back to the notes tab (goToNotesTab). This seems like way too much logic happening in one task...
I think we could extract the getToNotesTab
out, so that it's super clear and developers have to intentionally know what they're doing.
Also we should understand why we need to navigate out then back. Is that an issue with the notes tab not refreshing? Is that still necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first the goToNotesTab returns a cy.get but nothing is using that so it could be removed
I'm not sure what you mean. It's not returning the result of cy.get
. It uses it to perform further queries (.find('.euiBadge__text').invoke('text')...
)
we navigate to the query tab (goToQueryTab) then back to the notes tab (goToNotesTab)
Yeah, that looks fishy. Let me remove that and see if this has an affect on any of the notes tests. This should not be necessary anymore. That code was added 3 years ago, so a lot has happened since then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the last two gotos doesn't seem to have an impact on the timeline creation tests neither on the notes tests (which I had to unskip to test)
There was a problem hiding this comment.
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 you mean. It's not returning the result of cy.get. It uses it to perform further queries
I meant within the goToNotesTab
implementation, the last line returns like this
return cy.get(NOTES_TAB_BUTTON);
but everywhere we call it we call it like that
goToNotesTab();`
so we don't actually use the constant returned. Shouldn't we remove that last return line?
x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/creation.cy.ts
Show resolved
Hide resolved
x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/creation.cy.ts
Show resolved
Hide resolved
/ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for making all the changes, code looks great! I left a small comment but if the build is green feel free to ignore and merge. It's not super important and could be done within another PR later!
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: cc @janmonschke |
## Summary Unskips the fullscreen timeline tests. Looking at the issue described in #172547, it appears that the timeline was somehow not opening correctly in some cases. This flakiness has been removed in #173413, so it should be possible to unskip these tests. In addition to unskipping the tests, an unnecessary task execution was removed and two force clicks were cleaned up. [Flaky test runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4834) (200/200) fixes #172547
## Summary Unskips the fullscreen timeline tests. Looking at the issue described in elastic#172547, it appears that the timeline was somehow not opening correctly in some cases. This flakiness has been removed in elastic#173413, so it should be possible to unskip these tests. In addition to unskipping the tests, an unnecessary task execution was removed and two force clicks were cleaned up. [Flaky test runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4834) (200/200) fixes elastic#172547
Summary
The login as
t1_analyst
was not working sometimes. In order to reduce flakiness, we moved the role-based login to the test itself.The flaky test runner also showed that in some cases, we're failing to open the timeline in the tests. The click would perform, but somehow the timeline flyout wouldn't be open. Therefore we added some retry mechanisms to the opening logic (729e5ce).
Also:
context
callsshould
conventionFlaky test runner result (200/200)
fixes #173339