-
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
[Watcher] Fix flaky functional test #56393
Conversation
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
Also only update data (and call serializer) on a success response, not on an error response.
i appreciate you getting the jump on this issue, @jloleysens. |
@@ -35,6 +35,8 @@ export default function({ getService, getPageObjects }) { | |||
await browser.setWindowSize(1600, 1000); | |||
// TODO: Remove the retry.try wrapper once https://github.com/elastic/kibana/issues/55985 is resolved | |||
retry.try(async () => { | |||
// Try to give the license time to come through. | |||
await PageObjects.common.sleep(2000); |
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.
We need to remove this hard coded sleep. It's been my experience that this sometimes fails in CI. We might want to try using the retry.waitFor()
function and figure out a reasonable condition to wait for. We can wait for anything that can return true of false so if we need to wait for a license to be changed or something, we can hit the license API using the ES client. What do you think about that?
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.
Hey @cuff-links , that sounds reasonable :)
@elasticmachine merge upstream |
@elasticmachine merge upstream |
// | ||
// See this issue https://github.com/elastic/kibana/issues/55985 for future resolution. | ||
await retry.waitFor('watcher to display in management UI', async () => { | ||
try { |
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.
Hi, Jean-Louis. This is looking good so far. You can remove this extra try because retry.waitFor()
is just a wrapper function around try. So you don't need the second one. Other than that, we I think we are looking good.
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.
Ahh. Gotcha. I reran the test and you are correct. LGTM.
Thanks for taking a look again John!
The behavior without the try is different, though. If the element is not
found by webdriver it throws. This causes the wait for loop to also throw,
not retrying. Returning a Boolean here gives us the wait for behaviour of
retrying until a condition becomes true.
Let me know if this could be achieved differently though!
…On Fri, 07 Feb 2020 at 00:55, John Dorlus ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In x-pack/test/functional/apps/watcher/watcher_test.js
<#56393 (comment)>:
> - retry.try(async () => {
- // Try to give the license time to come through.
- await PageObjects.common.sleep(2000);
- await PageObjects.common.navigateToApp('watcher');
- await testSubjects.find('createWatchButton');
+
+ // License values are emitted ES -> Kibana Server -> Kibana Public. The current implementation
+ // creates a situation the Watcher plugin may not have received a minimum required license at setup time
+ // so the public app may not have registered in the UI.
+ //
+ // For functional testing this is a problem. The temporary solution is we wait for watcher
+ // to be visible.
+ //
+ // See this issue #55985 for future resolution.
+ await retry.waitFor('watcher to display in management UI', async () => {
+ try {
Hi, Jean-Louis. This is looking good so far. You can remove this extra try
because retry.waitFor() is just a wrapper function around try. So you
don't need the second one. Other than that, we I think we are looking good.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#56393?email_source=notifications&email_token=AB6G67ARQZDCG7CCVHRFAK3RBSPP5A5CNFSM4KNYEM5KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCUTKM2Q#pullrequestreview-354854506>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6G67FSILXDPKRYRZ3YR5TRBSPP5ANCNFSM4KNYEM5A>
.
|
// | ||
// See this issue https://github.com/elastic/kibana/issues/55985 for future resolution. | ||
await retry.waitFor('watcher to display in management UI', async () => { | ||
try { |
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.
Ahh. Gotcha. I reran the test and you are correct. LGTM.
@elasticmachine merge upstream |
* Give a bit more time for machines on CI * Remove unnecessary sleep * Dummy error logs [do not commit to master] * Revert "Dummy error logs [do not commit to master]" Also only update data (and call serializer) on a success response, not on an error response. * Remove common.sleep and rewrite the comment explaining the use of retry.waitFor * Fix typo Co-authored-by: Elastic Machine <[email protected]>
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* Give a bit more time for machines on CI * Remove unnecessary sleep * Dummy error logs [do not commit to master] * Revert "Dummy error logs [do not commit to master]" Also only update data (and call serializer) on a success response, not on an error response. * Remove common.sleep and rewrite the comment explaining the use of retry.waitFor * Fix typo Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Summary
Fixes #56014 introduced with #54752.
Additional Context
See meta this issue: #55985
Related Issues:
Previous work:
TODOs before review
Currently this PR is still trying to figure out the cause of the flakiness and is not ready to be merged. Consider the current changes all to be tentative (i.e., this should be a draft PR).