Skip to content

Commit

Permalink
support delaying Kibana shutdown to ensure all APM data is received
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Aug 3, 2021
1 parent b033f4f commit 3fe1d05
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export const schema = Joi.object()
})
.default(),
env: Joi.object().unknown().default(),
delayShutdown: Joi.number(),
})
.default(),

Expand Down
6 changes: 6 additions & 0 deletions packages/kbn-test/src/functional_tests/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ export async function runTests(options) {
await runFtr({ configPath, options: opts });
} finally {
try {
const delay = config.get('kbnTestServer.delayShutdown');
if (typeof delay === 'number') {
log.info('Delaying shutdown of Kibana for', delay, 'ms');
await new Promise((r) => setTimeout(r, delay));
}

await procs.stop('kibana');
} finally {
if (es) {
Expand Down
2 changes: 2 additions & 0 deletions x-pack/test/performance/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
.filter(([, v]) => !!v)
.reduce((acc, [k, v]) => (acc ? `${acc},${k}=${v}` : `${k}=${v}`), ''),
},
// delay shutdown by 15 seconds to ensure that APM can report the data it collects during test execution
delayShutdown: 15_000,
},
};
}

0 comments on commit 3fe1d05

Please sign in to comment.