Details

    • Type: Test Test
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.4, 3.0.3, 3.1
    • Fix Version/s: 2.9.4, 3.0.3, 3.1, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      As reported by Paolo Castagna on the mailing lists, some tests fail when you run them from eclipse.

      Some of the failures he reports are actually code problems such as base test classes not being
      abstract when they should be... we should fix things like that.

        Activity

        Hide
        Robert Muir added a comment -

        attached is a patch that makes CollationTestBase, BaseTestLRU, and BenchmarkTestCase abstract, as a start.

        Show
        Robert Muir added a comment - attached is a patch that makes CollationTestBase, BaseTestLRU, and BenchmarkTestCase abstract, as a start.
        Hide
        Robert Muir added a comment -

        I checked into this "lucene.common.dir", its only used currently in two places:
        1. a couple benchmark tests use it to create some .alg files, for example TestQualityRun

          private static String getReuters578LinesFile() {
            return System.getProperty("lucene.common.dir").replace('\\','/') +
              "/contrib/benchmark/src/test/org/apache/lucene/benchmark/quality/reuters.578.lines.txt.bz2";
          } 
        

        2. the memory index test uses it as a base to find files on your hard drive to index.
        I think this is similar to LUCENE-1756, and needs to also be fixed.

        If we could improve these tests in this way, we could remove this lucene.common.dir alltogether and simplify the build system, too.

        Show
        Robert Muir added a comment - I checked into this "lucene.common.dir", its only used currently in two places: 1. a couple benchmark tests use it to create some .alg files, for example TestQualityRun private static String getReuters578LinesFile() { return System .getProperty( "lucene.common.dir" ).replace('\\','/') + "/contrib/benchmark/src/test/org/apache/lucene/benchmark/quality/reuters.578.lines.txt.bz2" ; } 2. the memory index test uses it as a base to find files on your hard drive to index. I think this is similar to LUCENE-1756 , and needs to also be fixed. If we could improve these tests in this way, we could remove this lucene.common.dir alltogether and simplify the build system, too.
        Hide
        Robert Muir added a comment -

        Attached is an updated patch, with a new test for MemoryIndex.

        Instead of looking for stuff on your hard drive, it creates some randomish documents using a selection of strings that will match the test queries, combined with some random unicode strings ala TestStressIndexing2.

        This removes the use of lucene.common.dir here, so now moving on to the benchmark tests.

        Show
        Robert Muir added a comment - Attached is an updated patch, with a new test for MemoryIndex. Instead of looking for stuff on your hard drive, it creates some randomish documents using a selection of strings that will match the test queries, combined with some random unicode strings ala TestStressIndexing2. This removes the use of lucene.common.dir here, so now moving on to the benchmark tests.
        Hide
        Robert Muir added a comment -

        the attached patch refactors the benchmark tests:

        • logic to run a benchmark test is moved to BenchmarkTestCase
        • this forces them all to respect LuceneTestCase.TEMP_DIR for all file operations
        • lucene.common.dir is removed
        Show
        Robert Muir added a comment - the attached patch refactors the benchmark tests: logic to run a benchmark test is moved to BenchmarkTestCase this forces them all to respect LuceneTestCase.TEMP_DIR for all file operations lucene.common.dir is removed
        Hide
        Robert Muir added a comment -

        All tests pass with the latest patch, additionally I tested that the benchmark tests work from Eclipse.

        If no one objects I would like to commit in a bit.

        Show
        Robert Muir added a comment - All tests pass with the latest patch, additionally I tested that the benchmark tests work from Eclipse. If no one objects I would like to commit in a bit.
        Hide
        Michael McCandless added a comment -

        This is a great cleanup Robert! I love the copyToWorkDir...

        Show
        Michael McCandless added a comment - This is a great cleanup Robert! I love the copyToWorkDir...
        Hide
        Robert Muir added a comment -

        Committed revision 935014.

        Show
        Robert Muir added a comment - Committed revision 935014.
        Hide
        Robert Muir added a comment -

        Committed an additional fix: 935048, this allows you to run the contrib/ant tests from eclipse too.

        Show
        Robert Muir added a comment - Committed an additional fix: 935048, this allows you to run the contrib/ant tests from eclipse too.
        Hide
        Robert Muir added a comment -

        backported to 3.x: revision 941669

        Show
        Robert Muir added a comment - backported to 3.x: revision 941669
        Hide
        Robert Muir added a comment -

        I am reopening (not setting as blocker since its just a test issue, but it did cause tests to fail when reviewing the release).

        worst case, after the release, i think it would be good to backport the new MemoryIndexTest to the 2.9.x and 3.0.x branches.

        Show
        Robert Muir added a comment - I am reopening (not setting as blocker since its just a test issue, but it did cause tests to fail when reviewing the release). worst case, after the release, i think it would be good to backport the new MemoryIndexTest to the 2.9.x and 3.0.x branches.
        Hide
        Uwe Schindler added a comment -

        Here the patch that fixes the MemoryIndexTest bug in 3.0 / 2.9

        Show
        Uwe Schindler added a comment - Here the patch that fixes the MemoryIndexTest bug in 3.0 / 2.9
        Hide
        Uwe Schindler added a comment -

        Backported the MemoryIndexTest fixes to 2.9.4 and 3.0.3

        Show
        Uwe Schindler added a comment - Backported the MemoryIndexTest fixes to 2.9.4 and 3.0.3

          People

          • Assignee:
            Robert Muir
            Reporter:
            Robert Muir
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development