You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2022/02/20 14:10:00 UTC

[unomi] 02/02: UNOMI-552 Fix failing integration tests - Add comment to explain why we are using a <1 ratio for test validation

This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit ffb9e72ddc4e9d878390bbafcfcc55116d77f6ff
Author: Serge Huber <sh...@jahia.com>
AuthorDate: Sun Feb 20 12:40:58 2022 +0100

    UNOMI-552 Fix failing integration tests
    - Add comment to explain why we are using a <1 ratio for test validation
---
 itests/src/test/java/org/apache/unomi/itests/RuleServiceIT.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/itests/src/test/java/org/apache/unomi/itests/RuleServiceIT.java b/itests/src/test/java/org/apache/unomi/itests/RuleServiceIT.java
index 88d0865..2943d07 100644
--- a/itests/src/test/java/org/apache/unomi/itests/RuleServiceIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/RuleServiceIT.java
@@ -153,6 +153,8 @@ public class RuleServiceIT extends BaseIT {
 
         double improvementRatio = ((double) unoptimizedRunTime) / ((double) optimizedRunTime);
         LOGGER.info("Unoptimized run time = {}ms, optimized run time = {}ms. Improvement={}x", unoptimizedRunTime, optimizedRunTime, improvementRatio);
+        // we check with a ratio of 0.9 because the test can sometimes fail due to the fact that the sample size is small and can be affected by
+        // environmental issues such as CPU or I/O load.
         assertTrue("Optimized run time should be smaller than unoptimized", improvementRatio > 0.9);
     }