Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-1806

Unit test temp. files clutter /tmp directory; interfere with non-unique pathnames

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • Future
    • None
    • None

    Description

      The unit tests write many files and directories as direct children of directory /tmp and don't delete them. That clutters up /tmp. That also means that the state of /tmp/... can interfere with the tests.

      Also, because of that, many unit tests use file pathnames that are not unique to each test run. That means that simultaneous test runs can interfere. Additionally, given that the files are not deleted, that means that a later test run can be affected by an earlier test run. (Additionally, at least a few test methods write to the same relative file names, meaning those tests can interfere with each other.)

      Recommendations:

      1. At least change the parent directory from /tmp to a subdirectory of /tmp.
      2. Change to a parent directory whose name is unique to the test run (e.g., as JUnit's TemporaryFolder rule would create).
      3. Consider: Normally delete the temporary files after use (as TemporaryFolder does), but provide a convenient option to keep the files (possibly automatically defaulting to keeping in debugging mode).
      4. Probably use JUnit's TemporaryFolder rule (to get unique names, to delete after test). (Investigate how to conditionally disable deleting the files.)

      Attachments

        Activity

          People

            Unassigned Unassigned
            dsbos Daniel Barclay
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: