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

intermittent failures of TestTimeLimitedCollector.testTimeoutMultiThreaded in nightly tests

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      Patch Available

      Description

      Occasionly TestTimeLimitedCollector.testTimeoutMultiThreaded fails. e.g. with this output:

         [junit] ------------- Standard Error -----------------
         [junit] Exception in thread "Thread-97" junit.framework.AssertionFailedError: no hits found!
         [junit]     at junit.framework.Assert.fail(Assert.java:47)
         [junit]     at junit.framework.Assert.assertTrue(Assert.java:20)
         [junit]     at org.apache.lucene.search.TestTimeLimitedCollector.doTestTimeout(TestTimeLimitedCollector.java:152)
         [junit]     at org.apache.lucene.search.TestTimeLimitedCollector.access$100(TestTimeLimitedCollector.java:38)
         [junit]     at org.apache.lucene.search.TestTimeLimitedCollector$1.run(TestTimeLimitedCollector.java:231)
         [junit] Exception in thread "Thread-85" junit.framework.AssertionFailedError: no hits found!
         [junit]     at junit.framework.Assert.fail(Assert.java:47)
         [junit]     at junit.framework.Assert.assertTrue(Assert.java:20)
         [junit]     at org.apache.lucene.search.TestTimeLimitedCollector.doTestTimeout(TestTimeLimitedCollector.java:152)
         [junit]     at org.apache.lucene.search.TestTimeLimitedCollector.access$100(TestTimeLimitedCollector.java:38)
         [junit]     at org.apache.lucene.search.TestTimeLimitedCollector$1.run(TestTimeLimitedCollector.java:231)
         [junit] ------------- ---------------- ---------------
         [junit] Testcase: testTimeoutMultiThreaded(org.apache.lucene.search.TestTimeLimitedCollector):      FAILED
         [junit] some threads failed! expected:<50> but was:<48>
         [junit] junit.framework.AssertionFailedError: some threads failed! expected:<50> but was:<48>
         [junit]     at org.apache.lucene.search.TestTimeLimitedCollector.doTestMultiThreads(TestTimeLimitedCollector.java:255)
         [junit]     at org.apache.lucene.search.TestTimeLimitedCollector.testTimeoutMultiThreaded(TestTimeLimitedCollector.java:220)
         [junit]
      

      Problem either in test or in TimeLimitedCollector.

        Activity

        Hide
        doronc Doron Cohen added a comment -

        Committed.

        Show
        doronc Doron Cohen added a comment - Committed.
        Hide
        doronc Doron Cohen added a comment -

        I intend to commit this later today.

        Show
        doronc Doron Cohen added a comment - I intend to commit this later today.
        Hide
        doronc Doron Cohen added a comment -

        Problem was in test.

        However fix adds a greediness option to time-limited-collector (TLC):

        • A greedy TLC upon timeout would allow the wrapped collector to
          collect current doc and only then throw the timeout exception.
        • A non greedy TLC (the default, as before) will immediately throw the exception.

        For the test, setting to greedy allows to require that at least one doc was collected.

        I addition this patch:

        • Adds missing javadocs for TLC constructor.
        • Increase "slack" in timeout requirements in the test.
          This is to prevent further noise in this:
          HLC is required to timeout "not too soon and not too late", but in a busy machine
          the "not too late" part is problematic to test.
          I considered to removing this part (not too late), but decided to leave it in for now.
        • Adds a test for the setGreedy() option.

        All TLC tests pass.

        Show
        doronc Doron Cohen added a comment - Problem was in test. However fix adds a greediness option to time-limited-collector (TLC): A greedy TLC upon timeout would allow the wrapped collector to collect current doc and only then throw the timeout exception. A non greedy TLC (the default, as before) will immediately throw the exception. For the test, setting to greedy allows to require that at least one doc was collected. I addition this patch: Adds missing javadocs for TLC constructor. Increase "slack" in timeout requirements in the test. This is to prevent further noise in this: HLC is required to timeout "not too soon and not too late", but in a busy machine the "not too late" part is problematic to test. I considered to removing this part (not too late), but decided to leave it in for now. Adds a test for the setGreedy() option. All TLC tests pass.
        Hide
        doronc Doron Cohen added a comment -

        fixed typo in summary.

        Show
        doronc Doron Cohen added a comment - fixed typo in summary.

          People

          • Assignee:
            doronc Doron Cohen
            Reporter:
            doronc Doron Cohen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development