Skip to content

Commit

Permalink
Stabilize lens-to-ml test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pheyos committed Nov 8, 2022
1 parent e1734ed commit 832f93f
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('create jobs from lens', function () {
this.tags(['ml']);
let jobId: string;

before(async () => {
await ml.testResources.setKibanaTimeZoneToUTC();
Expand All @@ -57,9 +58,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.common.navigateToApp('dashboard');
});

afterEach(async () => {
await ml.api.deleteAnomalyDetectionJobES(jobId);
});

it('can create a single metric job from vis with single layer', async () => {
const selectedPanelTitle = 'panel2';
const jobId = 'job_from_lens_1';
jobId = 'job_from_lens_1';
const numberOfCompatibleLayers = 1;
const layerIndex = 0;

Expand Down Expand Up @@ -87,13 +92,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await ml.jobSelection.assertJobSelection([jobId]);

await ml.api.assertModelMemoryLimitForJob(jobId, '11mb');

await ml.api.deleteAnomalyDetectionJobES(jobId);
});

it('can create multi metric job from vis with single layer', async () => {
const selectedPanelTitle = 'panel1';
const jobId = 'job_from_lens_2';
jobId = 'job_from_lens_2';
const numberOfCompatibleLayers = 1;
const layerIndex = 0;

Expand Down Expand Up @@ -121,8 +124,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await ml.jobSelection.assertJobSelection([jobId]);

await ml.api.assertModelMemoryLimitForJob(jobId, '12mb');

await ml.api.deleteAnomalyDetectionJobES(jobId);
});
});
}

0 comments on commit 832f93f

Please sign in to comment.