Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4319

Refactor AtomicFileWritingIdiomTest to use TempDir annotation

    XMLWordPrintableJSON

Details

    • Patch

    Description

      Problem:
      Tests that manipulate external file resources need to guarantee resource integrity and availability. Test suite design and maintainability may suffer from the addition of assurance steps to guarantee parallel execution scenarios and resource leakage from failed previous executions.

      Solution:
      The use of @tempdir annotation assures a temporary directory being created and cleaned up for every test method execution, thus simplifying test maintenance steps.

      Using this approach, we will not create a redundancy build/test/tmp file under zookeeper/zookeeper-server directory, and we also don't need to remove the target file manually

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              elvyssoares Elvys Soares
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1m Original Estimate - 1m
                  1m
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h