Ensure es/kibana cleanup always happens when using scripts/functional_tests (#48986)

This commit is contained in:
Brian Seeders 2019-10-23 16:13:15 -04:00 committed by GitHub
parent 500cf271b0
commit d68eba6d96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,12 +82,20 @@ export async function runTests(options) {
await withProcRunner(log, async procs => {
const config = await readConfigFile(log, configPath);
const es = await runElasticsearch({ config, options: opts });
await runKibanaServer({ procs, config, options: opts });
await runFtr({ configPath, options: opts });
await procs.stop('kibana');
await es.cleanup();
let es;
try {
es = await runElasticsearch({ config, options: opts });
await runKibanaServer({ procs, config, options: opts });
await runFtr({ configPath, options: opts });
} finally {
try {
await procs.stop('kibana');
} finally {
if (es) {
await es.cleanup();
}
}
}
});
}
}