EdColeman commented on code in PR #4120:
URL: https://github.com/apache/accumulo/pull/4120#discussion_r1441883289


##########
test/src/main/java/org/apache/accumulo/test/conf/PropStoreConfigIT.java:
##########
@@ -330,6 +330,37 @@ public void modifyInstancePropertiesTest() throws 
Exception {
     }
   }
 
+  @Test
+  public void getSystemPropertiesTest() throws Exception {
+
+    // Tests that getSystemProperties() does not return a merged view from its 
parent configuration
+    // (only returns those set at the system level)
+
+    String customPropKey1 = "table.custom.prop1";
+    String customPropKey2 = "table.custom.prop2";
+    String customPropVal1 = "v1";
+    String customPropVal2 = "v2";
+    try (var client = Accumulo.newClient().from(getClientProps()).build()) {
+      // non-merged view
+      Map<String,String> sysProps = 
client.instanceOperations().getSystemProperties();
+      // merged view
+      Map<String,String> sysConfig = 
client.instanceOperations().getSystemConfiguration();
+      assertEquals(0, sysProps.size());
+      assertFalse(sysConfig.isEmpty());
+      client.instanceOperations().setProperty(customPropKey1, customPropVal1);
+      client.instanceOperations().setProperty(customPropKey2, customPropVal2);
+      sysProps = client.instanceOperations().getSystemProperties();

Review Comment:
   You may want to combine the assignment and test for expected size in 
Wait.waitFor() - the propagation of property changes occur asynchronously  
through ZooKeeper and when running in a constrained environment (like the CI 
environment) can cause the test to fail if the set and then checks occur before 
the update is propagated.
   
   Testing for the size = expected, or wait a short period and then retry 
should be sufficient and then the values could be checked for the expected 
values.



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