Solr
  1. Solr
  2. SOLR-2975

Solr test failure when running under Java 1.5

    Details

    • Type: Test Test
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5, 3.6
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Labels:
      None
    • Environment:

      Java 1.5 only. OS X

      Description

      ant test -Dtestcase=TestSolrEntityProcessorUnit fails when running under Java 1.5 because of faulty assumptions in the test.

      From e-mail thread (Hossman):
      ...those lines are assuming that row.entrySet will return something that
      has a predictible iteration order, but row is a Map of unknown creation
      (returned by the entityProcessor) ... so unless the entityProcessor is
      explicitly defined as returning something like SortedMap (which isn't
      suggested anywhere in this test) the test is making a really bad
      assumption.

      From e-mail. (Steven Rowe)
      FYI, I see this same failure when I run the branch_3x tests with Java 1.5, but not 1.6.
      and
      Oh, and the reason Jenkins isn't seeing this failure is that it runs branch_3x tests using Java 1.6, after first compiling with Java 1.5

      Even though we won't run Solr 4 under java 1.5, I'll change it there anyway since this is a bad assumption in the test.

      1. SOLR-2975.patch
        5 kB
        Erick Erickson
      2. SOLR-2975.patch
        11 kB
        Martijn van Groningen

        Activity

        Hide
        Erick Erickson added a comment -

        trunk - r1215487
        3x - r1215486

        Thanks Martijn!

        Show
        Erick Erickson added a comment - trunk - r1215487 3x - r1215486 Thanks Martijn!
        Hide
        Martijn van Groningen added a comment -

        If you want you can commit the fix to svn. You already assigned the issue

        Show
        Martijn van Groningen added a comment - If you want you can commit the fix to svn. You already assigned the issue
        Hide
        Erick Erickson added a comment -

        Fixes my failure up too. When do you want to commit this? I can take care of it if you want.

        Thanks lots, now I know about SolrTestCaseJ4.Doc, which solves the problem I was having when I tried to use a List<Map<String, Object>> and couldn't get the multiValued test to work.....

        Show
        Erick Erickson added a comment - Fixes my failure up too. When do you want to commit this? I can take care of it if you want. Thanks lots, now I know about SolrTestCaseJ4.Doc, which solves the problem I was having when I tried to use a List<Map<String, Object>> and couldn't get the multiValued test to work.....
        Hide
        Martijn van Groningen added a comment -

        Attached refactored version of test. I ran the test 10000 times on my machine with Java 1.5 and didn't have failures.

        There was also a concurrency issue in the testMultiThread() method. The access to the rowList variable wasn't synchronized. Also the ThreadPoolExecutor wasn't cleaned up. This resulted in memory issues and thread issues (OS couldn't create threads) if the tests were run for more then 2000 times.

        Show
        Martijn van Groningen added a comment - Attached refactored version of test. I ran the test 10000 times on my machine with Java 1.5 and didn't have failures. There was also a concurrency issue in the testMultiThread() method. The access to the rowList variable wasn't synchronized. Also the ThreadPoolExecutor wasn't cleaned up. This resulted in memory issues and thread issues (OS couldn't create threads) if the tests were run for more then 2000 times.
        Hide
        Erick Erickson added a comment -

        Running full test now, will check in shortly unless someone objects.

        Applies to both trunk and 3x

        Show
        Erick Erickson added a comment - Running full test now, will check in shortly unless someone objects. Applies to both trunk and 3x

          People

          • Assignee:
            Erick Erickson
            Reporter:
            Erick Erickson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development