Skip to content

Commit

Permalink
[packages/kbn-journeys] start apm after browser start and stop after …
Browse files Browse the repository at this point in the history
…browser is closed (#144267)
  • Loading branch information
dmlemeshko committed Nov 1, 2022
1 parent 7b04631 commit f8efa76
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/kbn-journeys/journey/journey_ftr_harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export class JourneyFtrHarness {

private async onSetup() {
await Promise.all([
this.setupApm(),
this.setupBrowserAndPage(),
asyncForEach(this.journeyConfig.getEsArchives(), async (esArchive) => {
await this.esArchiver.load(esArchive);
Expand All @@ -127,6 +126,10 @@ export class JourneyFtrHarness {
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.
await this.setupApm();
}

private async tearDownBrowserAndPage() {
Expand Down Expand Up @@ -181,9 +184,12 @@ export class JourneyFtrHarness {
}

private async onTeardown() {
await this.tearDownBrowserAndPage();
// It is important that we complete the APM transaction after we close the browser and before we start
// 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([
this.tearDownBrowserAndPage(),
this.teardownApm(),
asyncForEach(this.journeyConfig.getEsArchives(), async (esArchive) => {
await this.esArchiver.unload(esArchive);
}),
Expand Down

0 comments on commit f8efa76

Please sign in to comment.