You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Chung En Lee (Jira)" <ji...@apache.org> on 2026/05/14 10:49:00 UTC

[jira] [Created] (HDDS-15277) Refactor `TestContainerDataYaml` to ensure proper resource cleanup

Chung En Lee created HDDS-15277:
-----------------------------------

             Summary: Refactor `TestContainerDataYaml` to ensure proper resource cleanup
                 Key: HDDS-15277
                 URL: https://issues.apache.org/jira/browse/HDDS-15277
             Project: Apache Ozone
          Issue Type: Improvement
            Reporter: Chung En Lee


It was noted that the resource cleanup method in some unit tests is placed directly at the end of the test method block. 

The current implementation introduces a risk: if any assertion fails or if an unexpected Exception is thrown during execution, the test flow will be interrupted. Consequently, the `cleanup()` method at the end of the block will never be executed.

Refactor `TestContainerDataYaml` to guarantee that the resource cleanup logic is always triggered.

Please move the `cleanup()` logic to `@AfterEach` method within the test class so the testing framework manages it automatically.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org