Skip to content

Commit 6c366ed

Browse files
authored
[ML] Functional tests - remove by_field_count check for categorization jobs (#72033) (#72051)
This PR removes the validation of `total_by_field_count` for categorization jobs because the number of detected categories is not necessarily stable across analytics changes.
1 parent e800029 commit 6c366ed

File tree

4 files changed

+15
-120
lines changed

4 files changed

+15
-120
lines changed

x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts

Lines changed: 8 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export default function ({ getService }: FtrProviderContext) {
261261
modelSizeStats: {
262262
result_type: 'model_size_stats',
263263
model_bytes_exceeded: '0.0 B',
264-
total_by_field_count: '994',
264+
// not checking total_by_field_count as the number of categories might change
265265
total_over_field_count: '0',
266266
total_partition_field_count: '2',
267267
bucket_allocation_failures_count: '0',
@@ -274,8 +274,7 @@ export default function ({ getService }: FtrProviderContext) {
274274

275275
const calendarId = `wizard-test-calendar_${Date.now()}`;
276276

277-
// FLAKY: https://github.com/elastic/kibana/issues/71971
278-
describe.skip('advanced job', function () {
277+
describe('advanced job', function () {
279278
this.tags(['mlqa']);
280279
before(async () => {
281280
await esArchiver.loadIfNeeded('ml/ecommerce');
@@ -518,44 +517,18 @@ export default function ({ getService }: FtrProviderContext) {
518517
id: testData.jobId,
519518
description: testData.jobDescription,
520519
jobGroups: [...new Set(testData.jobGroups)].sort(),
521-
recordCount: testData.expected.row.recordCount,
522-
memoryStatus: testData.expected.row.memoryStatus,
523-
jobState: testData.expected.row.jobState,
524-
datafeedState: testData.expected.row.datafeedState,
525-
latestTimestamp: testData.expected.row.latestTimestamp,
520+
...testData.expected.row,
526521
});
527522

528523
await ml.jobTable.assertJobRowDetailsCounts(
529524
testData.jobId,
530525
{
531526
job_id: testData.jobId,
532-
processed_record_count: testData.expected.counts.processed_record_count,
533-
processed_field_count: testData.expected.counts.processed_field_count,
534-
input_bytes: testData.expected.counts.input_bytes,
535-
input_field_count: testData.expected.counts.input_field_count,
536-
invalid_date_count: testData.expected.counts.invalid_date_count,
537-
missing_field_count: testData.expected.counts.missing_field_count,
538-
out_of_order_timestamp_count: testData.expected.counts.out_of_order_timestamp_count,
539-
empty_bucket_count: testData.expected.counts.empty_bucket_count,
540-
sparse_bucket_count: testData.expected.counts.sparse_bucket_count,
541-
bucket_count: testData.expected.counts.bucket_count,
542-
earliest_record_timestamp: testData.expected.counts.earliest_record_timestamp,
543-
latest_record_timestamp: testData.expected.counts.latest_record_timestamp,
544-
input_record_count: testData.expected.counts.input_record_count,
545-
latest_bucket_timestamp: testData.expected.counts.latest_bucket_timestamp,
527+
...testData.expected.counts,
546528
},
547529
{
548530
job_id: testData.jobId,
549-
result_type: testData.expected.modelSizeStats.result_type,
550-
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
551-
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
552-
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
553-
total_partition_field_count:
554-
testData.expected.modelSizeStats.total_partition_field_count,
555-
bucket_allocation_failures_count:
556-
testData.expected.modelSizeStats.bucket_allocation_failures_count,
557-
memory_status: testData.expected.modelSizeStats.memory_status,
558-
timestamp: testData.expected.modelSizeStats.timestamp,
531+
...testData.expected.modelSizeStats,
559532
}
560533
);
561534
});
@@ -781,44 +754,18 @@ export default function ({ getService }: FtrProviderContext) {
781754
id: testData.jobIdClone,
782755
description: testData.jobDescription,
783756
jobGroups: [...new Set(testData.jobGroupsClone)].sort(),
784-
recordCount: testData.expected.row.recordCount,
785-
memoryStatus: testData.expected.row.memoryStatus,
786-
jobState: testData.expected.row.jobState,
787-
datafeedState: testData.expected.row.datafeedState,
788-
latestTimestamp: testData.expected.row.latestTimestamp,
757+
...testData.expected.row,
789758
});
790759

791760
await ml.jobTable.assertJobRowDetailsCounts(
792761
testData.jobIdClone,
793762
{
794763
job_id: testData.jobIdClone,
795-
processed_record_count: testData.expected.counts.processed_record_count,
796-
processed_field_count: testData.expected.counts.processed_field_count,
797-
input_bytes: testData.expected.counts.input_bytes,
798-
input_field_count: testData.expected.counts.input_field_count,
799-
invalid_date_count: testData.expected.counts.invalid_date_count,
800-
missing_field_count: testData.expected.counts.missing_field_count,
801-
out_of_order_timestamp_count: testData.expected.counts.out_of_order_timestamp_count,
802-
empty_bucket_count: testData.expected.counts.empty_bucket_count,
803-
sparse_bucket_count: testData.expected.counts.sparse_bucket_count,
804-
bucket_count: testData.expected.counts.bucket_count,
805-
earliest_record_timestamp: testData.expected.counts.earliest_record_timestamp,
806-
latest_record_timestamp: testData.expected.counts.latest_record_timestamp,
807-
input_record_count: testData.expected.counts.input_record_count,
808-
latest_bucket_timestamp: testData.expected.counts.latest_bucket_timestamp,
764+
...testData.expected.counts,
809765
},
810766
{
811767
job_id: testData.jobIdClone,
812-
result_type: testData.expected.modelSizeStats.result_type,
813-
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
814-
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
815-
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
816-
total_partition_field_count:
817-
testData.expected.modelSizeStats.total_partition_field_count,
818-
bucket_allocation_failures_count:
819-
testData.expected.modelSizeStats.bucket_allocation_failures_count,
820-
memory_status: testData.expected.modelSizeStats.memory_status,
821-
timestamp: testData.expected.modelSizeStats.timestamp,
768+
...testData.expected.modelSizeStats,
822769
}
823770
);
824771
});

x-pack/test/functional/apps/ml/anomaly_detection/categorization_job.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default function ({ getService }: FtrProviderContext) {
6464
job_id: expectedJobId,
6565
result_type: 'model_size_stats',
6666
model_bytes_exceeded: '0.0 B',
67-
total_by_field_count: '30',
67+
// not checking total_by_field_count as the number of categories might change
6868
total_over_field_count: '0',
6969
total_partition_field_count: '2',
7070
bucket_allocation_failures_count: '0',

x-pack/test/functional/apps/ml/anomaly_detection/date_nanos_job.ts

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -391,44 +391,18 @@ export default function ({ getService }: FtrProviderContext) {
391391
id: testData.jobId,
392392
description: testData.jobDescription,
393393
jobGroups: [...new Set(testData.jobGroups)].sort(),
394-
recordCount: testData.expected.row.recordCount,
395-
memoryStatus: testData.expected.row.memoryStatus,
396-
jobState: testData.expected.row.jobState,
397-
datafeedState: testData.expected.row.datafeedState,
398-
latestTimestamp: testData.expected.row.latestTimestamp,
394+
...testData.expected.row,
399395
});
400396

401397
await ml.jobTable.assertJobRowDetailsCounts(
402398
testData.jobId,
403399
{
404400
job_id: testData.jobId,
405-
processed_record_count: testData.expected.counts.processed_record_count,
406-
processed_field_count: testData.expected.counts.processed_field_count,
407-
input_bytes: testData.expected.counts.input_bytes,
408-
input_field_count: testData.expected.counts.input_field_count,
409-
invalid_date_count: testData.expected.counts.invalid_date_count,
410-
missing_field_count: testData.expected.counts.missing_field_count,
411-
out_of_order_timestamp_count: testData.expected.counts.out_of_order_timestamp_count,
412-
empty_bucket_count: testData.expected.counts.empty_bucket_count,
413-
sparse_bucket_count: testData.expected.counts.sparse_bucket_count,
414-
bucket_count: testData.expected.counts.bucket_count,
415-
earliest_record_timestamp: testData.expected.counts.earliest_record_timestamp,
416-
latest_record_timestamp: testData.expected.counts.latest_record_timestamp,
417-
input_record_count: testData.expected.counts.input_record_count,
418-
latest_bucket_timestamp: testData.expected.counts.latest_bucket_timestamp,
401+
...testData.expected.counts,
419402
},
420403
{
421404
job_id: testData.jobId,
422-
result_type: testData.expected.modelSizeStats.result_type,
423-
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
424-
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
425-
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
426-
total_partition_field_count:
427-
testData.expected.modelSizeStats.total_partition_field_count,
428-
bucket_allocation_failures_count:
429-
testData.expected.modelSizeStats.bucket_allocation_failures_count,
430-
memory_status: testData.expected.modelSizeStats.memory_status,
431-
timestamp: testData.expected.modelSizeStats.timestamp,
405+
...testData.expected.modelSizeStats,
432406
}
433407
);
434408
});

x-pack/test/functional/apps/ml/anomaly_detection/saved_search_job.ts

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -429,44 +429,18 @@ export default function ({ getService }: FtrProviderContext) {
429429
id: testData.jobId,
430430
description: testData.jobDescription,
431431
jobGroups: [...new Set(testData.jobGroups)].sort(),
432-
recordCount: testData.expected.row.recordCount,
433-
memoryStatus: testData.expected.row.memoryStatus,
434-
jobState: testData.expected.row.jobState,
435-
datafeedState: testData.expected.row.datafeedState,
436-
latestTimestamp: testData.expected.row.latestTimestamp,
432+
...testData.expected.row,
437433
});
438434

439435
await ml.jobTable.assertJobRowDetailsCounts(
440436
testData.jobId,
441437
{
442438
job_id: testData.jobId,
443-
processed_record_count: testData.expected.counts.processed_record_count,
444-
processed_field_count: testData.expected.counts.processed_field_count,
445-
input_bytes: testData.expected.counts.input_bytes,
446-
input_field_count: testData.expected.counts.input_field_count,
447-
invalid_date_count: testData.expected.counts.invalid_date_count,
448-
missing_field_count: testData.expected.counts.missing_field_count,
449-
out_of_order_timestamp_count: testData.expected.counts.out_of_order_timestamp_count,
450-
empty_bucket_count: testData.expected.counts.empty_bucket_count,
451-
sparse_bucket_count: testData.expected.counts.sparse_bucket_count,
452-
bucket_count: testData.expected.counts.bucket_count,
453-
earliest_record_timestamp: testData.expected.counts.earliest_record_timestamp,
454-
latest_record_timestamp: testData.expected.counts.latest_record_timestamp,
455-
input_record_count: testData.expected.counts.input_record_count,
456-
latest_bucket_timestamp: testData.expected.counts.latest_bucket_timestamp,
439+
...testData.expected.counts,
457440
},
458441
{
459442
job_id: testData.jobId,
460-
result_type: testData.expected.modelSizeStats.result_type,
461-
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
462-
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
463-
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
464-
total_partition_field_count:
465-
testData.expected.modelSizeStats.total_partition_field_count,
466-
bucket_allocation_failures_count:
467-
testData.expected.modelSizeStats.bucket_allocation_failures_count,
468-
memory_status: testData.expected.modelSizeStats.memory_status,
469-
timestamp: testData.expected.modelSizeStats.timestamp,
443+
...testData.expected.modelSizeStats,
470444
}
471445
);
472446
});

0 commit comments

Comments
 (0)