diff --git a/.buildkite/pipelines/performance/daily.yml b/.buildkite/pipelines/performance/daily.yml index ea7e406ba63d8..a37dedfd98235 100644 --- a/.buildkite/pipelines/performance/daily.yml +++ b/.buildkite/pipelines/performance/daily.yml @@ -27,11 +27,11 @@ steps: - exit_status: '*' limit: 1 - - label: '🚢 Performance Tests dataset extraction for scalability benchmarking' - command: .buildkite/scripts/steps/functional/scalability_dataset_extraction.sh - agents: - queue: n2-2 - depends_on: tests + # - label: '🚢 Performance Tests dataset extraction for scalability benchmarking' + # command: .buildkite/scripts/steps/functional/scalability_dataset_extraction.sh + # agents: + # queue: n2-2 + # depends_on: tests - label: '📈 Report performance metrics to ci-stats' command: .buildkite/scripts/steps/functional/report_performance_metrics.sh diff --git a/packages/kbn-journeys/journey/journey_ftr_harness.ts b/packages/kbn-journeys/journey/journey_ftr_harness.ts index 7b9d8cc0266fc..6bf9fea87fcfa 100644 --- a/packages/kbn-journeys/journey/journey_ftr_harness.ts +++ b/packages/kbn-journeys/journey/journey_ftr_harness.ts @@ -117,15 +117,21 @@ export class JourneyFtrHarness { } private async onSetup() { - await Promise.all([ - this.setupBrowserAndPage(), - asyncForEach(this.journeyConfig.getEsArchives(), async (esArchive) => { - await this.esArchiver.load(esArchive); - }), - asyncForEach(this.journeyConfig.getKbnArchives(), async (kbnArchive) => { - await this.kibanaServer.importExport.load(kbnArchive); - }), - ]); + await this.setupBrowserAndPage(); + + if ( + process.env.TEST_PERFORMANCE_PHASE === 'WARMUP' || + process.env.TEST_PERFORMANCE_PHASE === undefined + ) { + await Promise.all([ + asyncForEach(this.journeyConfig.getEsArchives(), async (esArchive) => { + await this.esArchiver.load(esArchive); + }), + asyncForEach(this.journeyConfig.getKbnArchives(), async (kbnArchive) => { + await this.kibanaServer.importExport.load(kbnArchive); + }), + ]); + } // It is important that we start the APM transaction after we open the browser and all the test data is loaded // so that the scalability data extractor can focus on just the APM data produced by Kibana running under test. @@ -189,14 +195,19 @@ export class JourneyFtrHarness { // unloading the test data so that the scalability data extractor can focus on just the APM data produced // by Kibana running under test. await this.teardownApm(); - await Promise.all([ - asyncForEach(this.journeyConfig.getEsArchives(), async (esArchive) => { + + if ( + process.env.TEST_PERFORMANCE_PHASE === 'TEST' || + process.env.TEST_PERFORMANCE_PHASE === undefined + ) { + // unload data + await asyncForEach(this.journeyConfig.getEsArchives(), async (esArchive) => { await this.esArchiver.unload(esArchive); - }), - asyncForEach(this.journeyConfig.getKbnArchives(), async (kbnArchive) => { - await this.kibanaServer.importExport.unload(kbnArchive); - }), - ]); + }); + // empty the kibana index + await this.esArchiver.emptyKibanaIndex(); + // TODO: delete the kibana index \ clean mappings? + } } private async onStepSuccess(step: AnyStep) { diff --git a/src/dev/performance/run_performance_cli.ts b/src/dev/performance/run_performance_cli.ts index ac0e708dcee0a..e63c744686b51 100644 --- a/src/dev/performance/run_performance_cli.ts +++ b/src/dev/performance/run_performance_cli.ts @@ -84,10 +84,10 @@ run( log.info(`Found ${journeys.length} journeys to run`); const failedJourneys = []; + await startEs(); for (const journey of journeys) { try { - await startEs(); await runWarmup(journey); await runTest(journey); } catch (e) { @@ -98,6 +98,8 @@ run( } } + await procRunner.stop('es'); + if (failedJourneys.length > 0) { throw new Error(`${failedJourneys.length} journeys failed: ${failedJourneys.join(',')}`); }