Skip to content

Commit 200cc23

Browse files
valeriy42albertzaharovits
authored andcommitted
[ML] Updated filtering in DetectionRulesIt.testCondition() (#110628)
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.
1 parent 4f67d1a commit 200cc23

File tree

1 file changed

+3
-0
lines changed
  • x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration

1 file changed

+3
-0
lines changed

x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DetectionRulesIT.java

+3
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ public void testCondition() throws Exception {
9595
closeJob(job.getId());
9696

9797
List<AnomalyRecord> records = getRecords(job.getId());
98+
// remove records that are not anomalies
99+
records.removeIf(record -> record.getInitialRecordScore() < 1e-5);
100+
98101
assertThat(records.size(), equalTo(1));
99102
assertThat(records.get(0).getByFieldValue(), equalTo("high"));
100103
long firstRecordTimestamp = records.get(0).getTimestamp().getTime();

0 commit comments

Comments
 (0)