ndimiduk commented on a change in pull request #1310: HBASE-23957 [flakey test] 
client.TestMultiParallel fails to read hbas…
URL: https://github.com/apache/hbase/pull/1310#discussion_r395934609
 
 

 ##########
 File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestUpdateConfiguration.java
 ##########
 @@ -49,57 +47,47 @@
 
   @BeforeClass
   public static void setup() throws Exception {
-    // Set master number and use default values for other options.
+    setUpConfigurationFiles(TEST_UTIL);
     StartMiniClusterOption option = 
StartMiniClusterOption.builder().numMasters(2).build();
     TEST_UTIL.startMiniCluster(option);
+    addResourceToRegionServerConfiguration(TEST_UTIL);
   }
 
+  @Rule
+  public TestName name = new TestName();
+
   @Test
   public void testOnlineConfigChange() throws IOException {
-    LOG.debug("Starting the test");
+    LOG.debug("Starting the test " + name.getMethodName());
     Admin admin = TEST_UTIL.getAdmin();
     ServerName server = 
TEST_UTIL.getHBaseCluster().getRegionServer(0).getServerName();
     admin.updateConfiguration(server);
   }
 
   @Test
   public void testMasterOnlineConfigChange() throws IOException {
-    LOG.debug("Starting the test");
-    Path cnfPath = 
FileSystems.getDefault().getPath("target/test-classes/hbase-site.xml");
-    Path cnf2Path = 
FileSystems.getDefault().getPath("target/test-classes/hbase-site2.xml");
-    Path cnf3Path = 
FileSystems.getDefault().getPath("target/test-classes/hbase-site3.xml");
-    // make a backup of hbase-site.xml
-    Files.copy(cnfPath, cnf3Path, StandardCopyOption.REPLACE_EXISTING);
-    // update hbase-site.xml by overwriting it
-    Files.copy(cnf2Path, cnfPath, StandardCopyOption.REPLACE_EXISTING);
-
+    LOG.debug("Starting the test " + name.getMethodName());
+    replaceHBaseSiteXML();
     Admin admin = TEST_UTIL.getAdmin();
     ServerName server = 
TEST_UTIL.getHBaseCluster().getMaster().getServerName();
     admin.updateConfiguration(server);
     Configuration conf = 
TEST_UTIL.getMiniHBaseCluster().getMaster().getConfiguration();
     int custom = conf.getInt("hbase.custom.config", 0);
     assertEquals(1000, custom);
-    // restore hbase-site.xml
-    Files.copy(cnf3Path, cnfPath, StandardCopyOption.REPLACE_EXISTING);
+    restoreHBaseSiteXML();
   }
 
   @Test
   public void testAllOnlineConfigChange() throws IOException {
-    LOG.debug("Starting the test");
+    LOG.debug("Starting the test " + name.getMethodName());
 
 Review comment:
   nit: we make a habit of using the logger's format string capability. That 
way it only performs the computation necessary to build the log message if the 
logger is emitting messages at the target level.
   
   ```java
   LOG.debug("Starting the test {}", name.getMethodName());
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to