Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-2673

Some Solr tests depend on order of test methods in source file, but Java 7 seems to no longer ensure that

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.4, 4.0-ALPHA
    • None

    Description

      With Java7 (b147) Solr tests fail, seems to be because of caching (maybe ConcurrentLRUCache violates Java Memory Model, which can be seen in Java 7 only):

      Example TestFiltering (passes sometimes):

      junit-sequential:
          [junit] Testsuite: org.apache.solr.search.TestFiltering
          [junit] Tests run: 2, Failures: 0, Errors: 1, Time elapsed: 6,082 sec
          [junit]
          [junit] ------------- Standard Error -----------------
          [junit] VII 24, 2011 4:53:02 AM org.apache.solr.SolrTestCaseJ4 assertJQ
          [junit] SEVERE: query failed JSON validation. error=mismatch: '3'!='2' @ response/docs/[0]/val_i
          [junit]  expected =/response/docs==[{"val_i":3}]
          [junit]  response = {
          [junit]   "responseHeader":{
          [junit]     "status":0,
          [junit]     "QTime":11},
          [junit]   "response":{"numFound":5,"start":2,"docs":[
          [junit]       {
          [junit]         "val_i":2}]
          [junit]   }}
          [junit]  request = fl=val_i&sort=val_i+asc&start=2&q={!cache%3Dfalse}*:*&rows=1
          [junit] NOTE: reproduce with: ant test -Dtestcase=TestFiltering -Dtestmethod=testCaching -Dtests.seed=9127548164660185224:-55134
      75064094727964
          [junit] NOTE: test params are: codec=RandomCodecProvider: {id=MockFixedIntBlock(blockSize=571), val_i=MockFixedIntBlock(blockSiz
      e=571)}, locale=bg, timezone=Pacific/Galapagos
          [junit] NOTE: all tests run in this JVM:
          [junit] [TestFiltering]
          [junit] NOTE: Windows 7 6.1 amd64/Oracle Corporation 1.7.0 (64-bit)/cpus=2,threads=1,free=253309552,total=262799360
          [junit] ------------- ---------------- ---------------
          [junit] Testcase: testCaching(org.apache.solr.search.TestFiltering):        Caused an ERROR
          [junit] mismatch: '3'!='2' @ response/docs/[0]/val_i
          [junit] java.lang.RuntimeException: mismatch: '3'!='2' @ response/docs/[0]/val_i
          [junit]     at org.apache.solr.SolrTestCaseJ4.assertJQ(SolrTestCaseJ4.java:467)
          [junit]     at org.apache.solr.SolrTestCaseJ4.assertJQ(SolrTestCaseJ4.java:415)
          [junit]     at org.apache.solr.search.TestFiltering.testCaching(TestFiltering.java:105)
          [junit]     at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:1486)
          [junit]     at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:1404)
          [junit]
          [junit]
          [junit] Test org.apache.solr.search.TestFiltering FAILED
      

      It is definitely not a Hotspot issue, as it also happens with -Xint and -Xbatch.

      Attachments

        1. SOLR-2673_randomize_methods.patch
          2 kB
          Robert Muir
        2. SOLR-2673_randomize_methods.patch
          2 kB
          Robert Muir
        3. SOLR-2673.patch
          0.5 kB
          Uwe Schindler

        Issue Links

          Activity

            People

              Unassigned Unassigned
              uschindler Uwe Schindler
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: