-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[test/dashboard] Retry filter check #11372
Conversation
if (!resp.length) throw new Error('expected filters'); | ||
return resp; | ||
}); | ||
}); |
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.
Since everything else is using await, could maybe follow suit and do:
// Try until we get filters back to avoid a potential timing issue.
// See https://github.com/elastic/kibana/issues/11339 for more info.
const originalFilters = await retry.try(async () => {
const filters = await PageObjects.dashboard.getFilters();
if (!filters.length) throw new Error('expected filters');
return filters;
});
Take it or leave it, just personal preference that it looks better to my eyes. Thanks for (hopefully) fixing this!
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.
Added in b240273
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.
LGTM. I suppose it doesn't matter if we run tests a few times since it only seems to break on 5.x and 5.4
* [test/dashboard] Retry filter check * [test/dashboard] Use await on getFilters
* [test/dashboard] Retry filter check * [test/dashboard] Use await on getFilters
I believe findAllByCssSelector is perfectly happy with returning 0 results and not waiting, so this wraps the getFilters method in a retry block.
Attempt at fixing #11339