Skip to content

Adding a readiness check before using services in tests #2099

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

Merged
merged 2 commits into from
Jun 8, 2023

Conversation

masseyke
Copy link
Member

@masseyke masseyke commented Jun 7, 2023

We have seen :qa:kerberos fail because it tries to run hiveLoadData before the hive server is actually up. We currently only check that the pidfile exists, which really only tells us that we have asked the hive server to start and that it has not crashed. I have seen this happen with hive but it could probably happen with any service if the service for some reason was slow enough coming up. This PR makes it so that each node in each role in each service used gives us a host/port pair, and we check that that port is reachable before attempting to use the node for that role.

Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

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

LGTM! Right on the money. Left a quick quality check comment, but otherwise looks perfect, thanks!

if ('HTTPS_ONLY' == hdfsSite.get('dfs.http.policy')) {
return getInetAddress(hdfsSite.getOrDefault('dfs.namenode.https-address', 'localhost:50470'))
} else {
return getInetAddress(hdfsSite.getOrDefault('dfs.namenode.https-address', 'localhost:50070'))
Copy link
Member

Choose a reason for hiding this comment

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

Should this be http-address instead of https-address? Looks like this and the datanode else blocks have identical code to the https case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh wow yeah. Good catch!

@masseyke masseyke merged commit 034cb57 into elastic:main Jun 8, 2023
@masseyke masseyke deleted the adding-readiness-check branch June 8, 2023 18:07
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.

2 participants