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

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


The following commit(s) were added to refs/heads/upgradeESSocketTimeout by this 
push:
     new b6ffcf844 remove non required test
b6ffcf844 is described below

commit b6ffcf844a80cfa145c7ddb252e5a0701533086e
Author: David Griffon <dgrif...@jahia.com>
AuthorDate: Tue Aug 1 11:48:18 2023 +0200

    remove non required test
---
 .../java/org/apache/unomi/itests/SegmentIT.java    | 65 ----------------------
 1 file changed, 65 deletions(-)

diff --git a/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java 
b/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
index 191f99b35..3b3aa9314 100644
--- a/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java
@@ -727,69 +727,4 @@ public class SegmentIT extends BaseIT {
                         updatedProfile.getScores() == null || 
!updatedProfile.getScores().containsKey("relative-date-scoring-test")), 1000,
                 20);
     }
-
-
-    @Test
-    public void testScoringRecalculationTimeout() throws Exception {
-        Configuration elasticSearchConfiguration = 
configurationAdmin.getConfiguration("org.apache.unomi.persistence.elasticsearch");
-        String currentClientSocketTimeout = (String) 
elasticSearchConfiguration.getProperties().get("clientSocketTimeout");
-
-        // create a lot of profiles
-        for (int i = 0; i <= 100000; i++) {
-            String profileId = "test_profile_id_" + i;
-
-            LOGGER.info("Creating profile: " + profileId);
-            Profile profile = new Profile();
-            profile.setSystemProperty("lastUpdated", new Date());
-            profile.setItemId(profileId);
-
-            persistenceService.save(profile, true);
-
-            // save events for the profiles
-            Date timestampEventInRange = new 
SimpleDateFormat("yyyy-MM-dd").parse("2000-10-30");
-            persistenceService.save(new Event("test-event-type", null, 
profile, null, null, profile, timestampEventInRange), true);
-        }
-        refreshPersistence(Event.class, Profile.class);
-
-        // create the past event condition
-        Condition pastEventCondition = new 
Condition(definitionsService.getConditionType("pastEventCondition"));
-        pastEventCondition.setParameter("minimumEventCount", 1);
-        pastEventCondition.setParameter("maximumEventCount", 2);
-
-        pastEventCondition.setParameter("fromDate", "2000-07-15T07:00:00Z");
-        pastEventCondition.setParameter("toDate", "2001-01-15T07:00:00Z");
-        ;
-        Condition pastEventEventCondition = new 
Condition(definitionsService.getConditionType("eventTypeCondition"));
-        pastEventEventCondition.setParameter("eventTypeId", "test-event-type");
-        pastEventCondition.setParameter("eventCondition", 
pastEventEventCondition);
-
-        // create the scoring
-        Metadata scoringMetadata = new 
Metadata("scoring-recalculation-socket-timeout");
-        Scoring scoring = new Scoring(scoringMetadata);
-        List<ScoringElement> scoringElements = new ArrayList<>();
-        ScoringElement scoringElement = new ScoringElement();
-        scoringElement.setCondition(pastEventCondition);
-        scoringElement.setValue(50);
-        scoringElements.add(scoringElement);
-        scoring.setElements(scoringElements);
-
-        Map<String, Object> configUpdate = new HashMap<>();
-        configUpdate.put("clientSocketTimeout", "50");
-        updateConfiguration(PersistenceService.class.getName(), 
"org.apache.unomi.persistence.elasticsearch", configUpdate);
-
-        try {
-            segmentService.setScoringDefinition(scoring);
-        } finally {
-            configUpdate.put("clientSocketTimeout", 
currentClientSocketTimeout);
-            updateConfiguration(PersistenceService.class.getName(), 
"org.apache.unomi.persistence.elasticsearch", configUpdate);
-        }
-
-        keepTrying("Check that profiles are correctly updated by the ES task", 
() -> {
-                    Condition condition = new 
Condition(definitionsService.getConditionType("scoringCondition"));
-                    condition.setParameter("scoringPlanId", 
"scoring-recalculation-socket-timeout");
-                    condition.setParameter("scoreValue", 50);
-                    return persistenceService.queryCount(condition, 
Profile.ITEM_TYPE);
-                },
-                count -> count == 100001, DEFAULT_TRYING_TIMEOUT, 
DEFAULT_TRYING_TRIES);
-    }
 }

Reply via email to