Lucene - Core
  1. Lucene - Core
  2. LUCENE-3184

add LuceneTestCase.rarely()/LuceneTestCase.atLeast()

    Details

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

      Description

      in LUCENE-3175, the tests were sped up a lot by using reasonable number of iterations normally, but cranking up for NIGHTLY.
      we also do crazy things more 'rarely' for normal builds (e.g. simpletext, payloads, crazy merge params, etc)
      also, we found some bugs by doing this, because in general our parameters are too fixed.

      however, it made the code look messy... I propose some new methods:
      instead of some crazy code in your test like:

      int numdocs = (TEST_NIGHTLY ? 1000 : 100) * RANDOM_MULTIPLIER;
      

      you use:

      int numdocs = atLeast(100);
      

      this will apply the multiplier, also factor in nightly, and finally add some random fudge... so e.g. in local runs its sometimes 127 docs, sometimes 113 docs, etc.

      additionally instead of code like:

      if ((TEST_NIGHTLY && random.nextBoolean()) || (random.nextInt(20) == 17)) {
      

      you do

      if (rarely()) {
      

      which applies NIGHTLY and also the multiplier (logarithmic growth).

        Activity

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development