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

[test/dashboard] Retry filter check #11372

Merged
merged 2 commits into from
Apr 21, 2017
Merged

[test/dashboard] Retry filter check #11372

merged 2 commits into from
Apr 21, 2017

Conversation

jbudz
Copy link
Member

@jbudz jbudz commented Apr 21, 2017

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

if (!resp.length) throw new Error('expected filters');
return resp;
});
});
Copy link
Contributor

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!

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in b240273

Copy link
Contributor

@stacey-gammon stacey-gammon left a 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

@jbudz jbudz merged commit 5a6766b into elastic:master Apr 21, 2017
@jbudz jbudz mentioned this pull request Apr 21, 2017
jbudz added a commit that referenced this pull request Apr 21, 2017
* [test/dashboard] Retry filter check

* [test/dashboard] Use await on getFilters
jbudz added a commit that referenced this pull request Apr 21, 2017
* [test/dashboard] Retry filter check

* [test/dashboard] Use await on getFilters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants