Skip to content

Commit

Permalink
[ML] Updated filtering in DetectionRulesIt.testCondition() (#110628)
Browse files Browse the repository at this point in the history
While working on elastic/ml-cpp#2677, I encountered a failure in the integration test DetectionRulesIt.testCondition(). It checks the number of return records. With the new change in ml-cpp the native code returns two more values that have no significant score. I added filtering those out in the integration test code so it continues working as expected.
  • Loading branch information
valeriy42 authored Jul 9, 2024
1 parent 5d3512f commit 8e04af9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ public void testCondition() throws Exception {
closeJob(job.getId());

List<AnomalyRecord> records = getRecords(job.getId());
// remove records that are not anomalies
records.removeIf(record -> record.getInitialRecordScore() < 1e-5);

assertThat(records.size(), equalTo(1));
assertThat(records.get(0).getByFieldValue(), equalTo("high"));
long firstRecordTimestamp = records.get(0).getTimestamp().getTime();
Expand Down

0 comments on commit 8e04af9

Please sign in to comment.