the-other-tim-brown commented on code in PR #9642:
URL: https://github.com/apache/hudi/pull/9642#discussion_r1318778848


##########
hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestRestoresCommand.java:
##########
@@ -114,18 +114,18 @@ public void init() throws Exception {
 
     
hoodieTestTable.addCommit("103").withBaseFilesInPartitions(partitionAndFileId);
 
-    BaseHoodieWriteClient client = new SparkRDDWriteClient(context(), config);
-    client.rollback("103");
-    client.restoreToSavepoint("102");
-
-    
hoodieTestTable.addCommit("105").withBaseFilesInPartitions(partitionAndFileId);
-    HoodieSavepointMetadata savepointMetadata = 
hoodieTestTable.doSavepoint("105");
-    hoodieTestTable.addSavepoint("105", savepointMetadata);
-
-    
hoodieTestTable.addCommit("106").withBaseFilesInPartitions(partitionAndFileId);
-    client.rollback("106");
-    client.restoreToSavepoint("105");
-    client.close();
+    try (BaseHoodieWriteClient client = new SparkRDDWriteClient(context(), 
config)) {

Review Comment:
   Lots of places are showing larger diffs due to indentation. I've biased 
towards try-with-resources in the tests incase there is a failure in a test, we 
still close the client.



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