Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-2349

Tests should use unique temporary directories

    XMLWordPrintableJSON

    Details

    • Type: Test
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.1
    • Fix Version/s: None
    • Component/s: general/build
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      We cannot safely use parallel tests (LUCENE-1709) because some test classes try to use temporary directories with the same name.
      So if these two happen to run at the same time, they conflict.

      For example TestIndexReader has code like this:

      File dirFile = new File(TEMP_DIR, "testIndex");
      

      But TestCompoundFile has similar code:

      File file = new File(TEMP_DIR, "testIndex");
      

      If both these classes run at the same time, there will be problems.

      If we want to use parallel tests safely, we have to fix this use of the static TEMP_DIR which does not include any unique name of the test.
      Ideally we can do this without changing a lot of test code, especially backwards.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rcmuir Robert Muir
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: