Lucene - Core
  1. Lucene - Core
  2. LUCENE-2727

simulate out of open files in MockDirectoryWrapper

    Details

    • Type: Test Test
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3, 5.0
    • Component/s: general/build
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      currently we do disk-full tests (in writeBytes), but it would be good to have test coverage for the case
      where the machine runs out of open files.

      1. LUCENE-2727.patch
        2 kB
        Robert Muir
      2. LUCENE-2727.patch
        6 kB
        Robert Muir

        Activity

        Hide
        Robert Muir added a comment -

        this is likely not the best way to do it, maybe we should actually track this idea separately (like disk full).

        But as a start i thought it might work to maybeThrowDeterministicException in openInput/createOutput...
        though I'm not sure how many tests will give us coverage here.

        Show
        Robert Muir added a comment - this is likely not the best way to do it, maybe we should actually track this idea separately (like disk full). But as a start i thought it might work to maybeThrowDeterministicException in openInput/createOutput... though I'm not sure how many tests will give us coverage here.
        Hide
        Michael McCandless added a comment -

        This looks like a great start!

        So any test that has enabled MockDirW's deterministic exceptions will now have a chance to throw on opening input or creating output.

        Hmm... should we also call maybeThrowIOException? Maybe make a new method maybeThrowAnyException

        Show
        Michael McCandless added a comment - This looks like a great start! So any test that has enabled MockDirW's deterministic exceptions will now have a chance to throw on opening input or creating output. Hmm... should we also call maybeThrowIOException? Maybe make a new method maybeThrowAnyException
        Hide
        Robert Muir added a comment -

        Hmm... should we also call maybeThrowIOException? Maybe make a new method maybeThrowAnyException

        good idea it seems more tests turn on the random IOExceptions than register failOns, so we get more coverage.

        Just gotta fix the tests (properly) to ignore/retry on these fake exceptions in certain places.

        Show
        Robert Muir added a comment - Hmm... should we also call maybeThrowIOException? Maybe make a new method maybeThrowAnyException good idea it seems more tests turn on the random IOExceptions than register failOns, so we get more coverage. Just gotta fix the tests (properly) to ignore/retry on these fake exceptions in certain places.
        Hide
        Robert Muir added a comment -

        ok here's another start, using the idea of maybeThrowIOException too.

        this makes things somewhat tricky, really tests that enable these ioexceptions aren't very prepared to handle them coming from the reader (note: the MockIndexInput etc never throws these, only output!)

        i hacked a few of the tests, and _TestUtil.checkIndex, but there are a still a few more that need to be fixed.

        The problem is, these are some of our best tests and I don't want us to actually lose coverage here...

        Show
        Robert Muir added a comment - ok here's another start, using the idea of maybeThrowIOException too. this makes things somewhat tricky, really tests that enable these ioexceptions aren't very prepared to handle them coming from the reader (note: the MockIndexInput etc never throws these, only output!) i hacked a few of the tests, and _TestUtil.checkIndex, but there are a still a few more that need to be fixed. The problem is, these are some of our best tests and I don't want us to actually lose coverage here...
        Hide
        Michael McCandless added a comment -

        I just committed LUCENE-4738, which adds MDW.setRandomIOExceptionRateOnOpen to sometimes randomly throw exceptions from openInput and createOutput ...

        But we still need to fix more tests to enable this ...

        Show
        Michael McCandless added a comment - I just committed LUCENE-4738 , which adds MDW.setRandomIOExceptionRateOnOpen to sometimes randomly throw exceptions from openInput and createOutput ... But we still need to fix more tests to enable this ...
        Hide
        Uwe Schindler added a comment -

        Closed after release.

        Show
        Uwe Schindler added a comment - Closed after release.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development