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

[tests/functional] catch and ignore errors during stabilization #11906

Conversation

spalger
Copy link
Contributor

@spalger spalger commented May 18, 2017

The kibanaServer service in the functional tests has a waitForStabilization() method that is called automatically before every test and tries to make sure that the kibana server isn't in a bad state before continuing. It does this by pinging the /api/status route and checking for the config document in elasticsearch.

A recent failure in the tests shows that elasticsearch responded with a 503 at this time, which is surprising but ultimately not something that should take down the waitForStabilization() method, so these changes update the method to catch and log/ignore errors thrown during the check procedure.

@spalger spalger added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc test v5.5.0 v6.0.0 labels May 18, 2017
@spalger spalger requested a review from rhoboat May 18, 2017 17:49
@spalger
Copy link
Contributor Author

spalger commented May 18, 2017

jenkins, test this

Copy link

@rhoboat rhoboat left a comment

Choose a reason for hiding this comment

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

This has been on my mind, so I'm glad we have this PR. Thanks, @spalger.

But, why do we have to wait for the config doc to be available in ES before it's considered stable, and therefore allowed to start? Is there a way to start up kibana without a .kibana? And just keep trying to create it in the background?

@@ -32,29 +32,36 @@ export function KibanaServerProvider({ getService }) {
const startMs = Date.now();
const timeout = config.get('timeouts.kibanaStabilize');

let exists;
let state;
Copy link

Choose a reason for hiding this comment

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

pulling these out does make sense.

@spalger
Copy link
Contributor Author

spalger commented May 25, 2017

@archanid we don't have to, with enough retries things will eventually stabilize because the Kibana server is continuously checking for the config doc and creating it (or the whole .kibana index) when necessary. Adding enough retries in the right place is the tricky part though, this just tries to make the baseline for tests a bit more predictable.

Copy link

@rhoboat rhoboat left a comment

Choose a reason for hiding this comment

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

LGTM

return;
}
} catch (err) {
log.warning(`Failed to check for kibana stabilization: ${err.stack}`);
Copy link

Choose a reason for hiding this comment

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

makes a lot of sense

@spalger spalger merged commit eb31af6 into elastic:master May 25, 2017
spalger added a commit that referenced this pull request May 25, 2017
@spalger
Copy link
Contributor Author

spalger commented May 25, 2017

5.5/5.x: 0527267

@spalger spalger deleted the fix/test-functional-kibanaserver-errors-while-waiting-for-stablization branch October 18, 2019 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc test v5.5.0 v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants