yandrey321 commented on code in PR #9629:
URL: https://github.com/apache/ozone/pull/9629#discussion_r2712839074


##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/ReconTestInjector.java:
##########
@@ -233,6 +233,31 @@ public OzoneConfiguration getTestOzoneConfiguration(
     return configuration;
   }
 
+  /**
+   * Closes all resources created by this injector.
+   * This should be called in test tearDown methods to ensure proper cleanup.
+   *
+   * @throws Exception if any resource fails to close
+   */
+  public void close() throws Exception {
+    // Close ReconDBProvider if it was created
+    if (withContainerDB && injector != null) {
+      try {
+        ReconDBProvider reconDBProvider =
+            injector.getInstance(ReconDBProvider.class);
+        if (reconDBProvider != null) {
+          reconDBProvider.close();
+        }
+      } catch (Exception e) {
+      }

Review Comment:
   in case of exception here we should fail the test.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to