sk0x50 commented on a change in pull request #9248:
URL: https://github.com/apache/ignite/pull/9248#discussion_r670702096



##########
File path: 
modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerPropertiesTest.java
##########
@@ -197,4 +199,47 @@ public void testPropertyDefaultQueryTimeout() {
             )
         );
     }
+
+    /**
+     * Check the set command for property 'history.rebalance.threshold'.
+     */
+    @Test
+    public void testPropertyWalRebalanceThreshold() {
+        
assertDistributedPropertyEquals(HISTORICAL_REBALANCE_THRESHOLD_DMS_KEY, 
DFLT_PDS_WAL_REBALANCE_THRESHOLD, true);
+
+        int newVal = DFLT_PDS_WAL_REBALANCE_THRESHOLD * 2;
+
+        assertEquals(
+                EXIT_CODE_OK,
+                execute(
+                        "--property", "set",
+                        "--name", HISTORICAL_REBALANCE_THRESHOLD_DMS_KEY,
+                        "--val", Integer.toString(newVal)
+                )
+        );
+
+        
assertDistributedPropertyEquals(HISTORICAL_REBALANCE_THRESHOLD_DMS_KEY, newVal, 
true);
+    }
+
+    /**
+     * Validates that distributed property has specified value across all 
nodes.
+     *
+     * @param propName Distributed property name.
+     * @param expected Expected property value.
+     * @param onlyServerMode Ignore client nodes.
+     * @param <T> Property type.
+     */
+    private <T extends Serializable> void 
assertDistributedPropertyEquals(String propName, T expected, boolean 
onlyServerMode) {
+        for (Ignite ign : G.allGrids()) {
+            IgniteEx ignEx = (IgniteEx) ign;
+
+            if (onlyServerMode && ign.configuration().isClientMode())
+                continue;
+
+            DistributedChangeableProperty<Serializable> prop =
+                    
ignEx.context().distributedConfiguration().property(propName);
+
+            assertEquals(prop.get(), expected);

Review comment:
       It would be nice to add a human-readable message here that includes a 
node name at least. Something like as follows:
   ```
       assertEquals(
           "Validation has failed on the cluster node [name=" + 
ignEx.config().getIgniteInstanceName + ']', 
           prop.get(), 
          expected);
   ```




-- 
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