alievmirza commented on code in PR #2957:
URL: https://github.com/apache/ignite-3/pull/2957#discussion_r1433916923


##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,73 +996,171 @@ void simpleTopologyChanges() throws Exception {
      * @throws Exception If failed.
      */
     @Test
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412";)
-    void checkDataNodesRepeated() throws Exception {
-        prepareZonesWithOneDataNodes();
+    void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+        prepareZonesWithTwoDataNodes();
 
         prepareZonesTimerValuesToTest();
 
-        CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+        CountDownLatch latch = new CountDownLatch(1);
+
+        AtomicBoolean reached = new AtomicBoolean();
 
-        CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+        Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), 
NODE_1.name(), NODE_2.name());
+        Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), 
NODE_1.name(), NODE_2.name());
+        Set<String> expectedZone2DataNodes = Set.of(NODE_0.name(), 
NODE_1.name());
+        Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), 
NODE_1.name());
+        Set<String> expectedZone4DataNodes1 = Set.of(NODE_0.name(), 
NODE_1.name());
+        Set<String> expectedZone4DataNodes2 = Set.of(NODE_0.name(), 
NODE_1.name(), NODE_2.name());

Review Comment:
   let's add this expected nodes to list and pass this as a value to all 
related methods like `createLogicalTopologyWatchListenerToCheckDataNodes`, 
`checkThatDataNodesIsChangedInMetastorage` etc



##########
modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/causalitydatanodes/DistributionZoneCausalityDataNodesTest.java:
##########
@@ -1013,73 +996,171 @@ void simpleTopologyChanges() throws Exception {
      * @throws Exception If failed.
      */
     @Test
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-20412";)
-    void checkDataNodesRepeated() throws Exception {
-        prepareZonesWithOneDataNodes();
+    void checkDataNodesRepeatedOnNodeAdded() throws Exception {
+        prepareZonesWithTwoDataNodes();
 
         prepareZonesTimerValuesToTest();
 
-        CountDownLatch scaleUpLatch = blockScaleUpTaskExecution();
+        CountDownLatch latch = new CountDownLatch(1);
+
+        AtomicBoolean reached = new AtomicBoolean();
 
-        CountDownLatch scaleDownLatch = blockScaleDownTaskExecution();
+        Set<String> expectedDefaultZoneDataNodes = Set.of(NODE_0.name(), 
NODE_1.name(), NODE_2.name());
+        Set<String> expectedZone1DataNodes = Set.of(NODE_0.name(), 
NODE_1.name(), NODE_2.name());
+        Set<String> expectedZone2DataNodes = Set.of(NODE_0.name(), 
NODE_1.name());
+        Set<String> expectedZone3DataNodes = Set.of(NODE_0.name(), 
NODE_1.name());
+        Set<String> expectedZone4DataNodes1 = Set.of(NODE_0.name(), 
NODE_1.name());
+        Set<String> expectedZone4DataNodes2 = Set.of(NODE_0.name(), 
NODE_1.name(), NODE_2.name());

Review Comment:
   Please also refactor all 
`createLogicalTopologyWatchListenerToCheckDataNodes`, 
`checkThatDataNodesIsChangedInMetastorage`, `checkDataNodes` etc, so they just 
iterate through the list and check, but not copy-paste `assertValueInStorage` 
call



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to