openinx commented on a change in pull request #14032: URL: https://github.com/apache/flink/pull/14032#discussion_r522838516
########## File path: flink-end-to-end-tests/flink-end-to-end-tests-hbase/src/main/java/org/apache/flink/tests/util/hbase/LocalStandaloneHBaseResource.java ########## @@ -92,62 +95,98 @@ private void setupHBaseDist() throws IOException { } private void setupHBaseCluster() throws IOException { - LOG.info("Starting HBase cluster"); - AutoClosableProcess.runBlocking( - hbaseDir.resolve(Paths.get("bin", "start-hbase.sh")).toString()); - - while (!isHBaseRunning()) { - try { - LOG.info("Waiting for HBase to start"); - Thread.sleep(500L); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - break; - } - } + LOG.info("Starting HBase cluster..."); + runHBaseProcessWithRetry("start-hbase.sh", () -> !isHMasterRunning()); + LOG.info("Start HBase cluster success"); } @Override public void afterTestSuccess() { + shutdownResource(); + downloadCache.afterTestSuccess(); + tmp.delete(); + } + + private void shutdownResource() { + LOG.info("Stopping HBase Cluster..."); try { - LOG.info("Stopping HBase Cluster"); - AutoClosableProcess.runBlocking( - hbaseDir.resolve(Paths.get("bin", "hbase-daemon.sh")).toString(), - "stop", - "master"); + runHBaseProcessWithRetry("stop-hbase.sh", () -> isHMasterAlive()); Review comment: I'd prefer to shutdown the hbase process by killing the process id because I encountered the hung case before when calling the `stop-hbase.sh`. ---------------------------------------------------------------- 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: us...@infra.apache.org