mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[ML] Functional tests - stabilize AD job delete test (#88148)
This PR stabilizes the AD job delete tests by waiting for the job to not exist anymore before checking the job list.
This commit is contained in:
parent
4c5d8be8da
commit
e274a60927
3 changed files with 6 additions and 4 deletions
|
@ -343,6 +343,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.testExecution.logTestStep('job deletion confirms the delete modal');
|
||||
await ml.jobTable.confirmDeleteJobModal();
|
||||
await ml.api.waitForAnomalyDetectionJobNotToExist(jobIdClone, 30 * 1000);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
'job deletion does not display the deleted job in the job list any more'
|
||||
|
|
|
@ -326,6 +326,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.testExecution.logTestStep('job deletion confirms the delete modal');
|
||||
await ml.jobTable.confirmDeleteJobModal();
|
||||
await ml.api.waitForAnomalyDetectionJobNotToExist(jobIdClone, 30 * 1000);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
'job deletion does not display the deleted job in the job list any more'
|
||||
|
|
|
@ -454,8 +454,8 @@ export function MachineLearningAPIProvider({ getService }: FtrProviderContext) {
|
|||
return await esSupertest.get(`/_ml/anomaly_detectors/${jobId}`).expect(200);
|
||||
},
|
||||
|
||||
async waitForAnomalyDetectionJobToExist(jobId: string) {
|
||||
await retry.waitForWithTimeout(`'${jobId}' to exist`, 5 * 1000, async () => {
|
||||
async waitForAnomalyDetectionJobToExist(jobId: string, timeout: number = 5 * 1000) {
|
||||
await retry.waitForWithTimeout(`'${jobId}' to exist`, timeout, async () => {
|
||||
if (await this.getAnomalyDetectionJob(jobId)) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -464,8 +464,8 @@ export function MachineLearningAPIProvider({ getService }: FtrProviderContext) {
|
|||
});
|
||||
},
|
||||
|
||||
async waitForAnomalyDetectionJobNotToExist(jobId: string) {
|
||||
await retry.waitForWithTimeout(`'${jobId}' to not exist`, 5 * 1000, async () => {
|
||||
async waitForAnomalyDetectionJobNotToExist(jobId: string, timeout: number = 5 * 1000) {
|
||||
await retry.waitForWithTimeout(`'${jobId}' to not exist`, timeout, async () => {
|
||||
if (await esSupertest.get(`/_ml/anomaly_detectors/${jobId}`).expect(404)) {
|
||||
return true;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue