lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <>
Subject [jira] Updated: (LUCENE-2570) Some improvements to _TestUtil and its usage
Date Tue, 27 Jul 2010 10:44:15 GMT


Shai Erera updated LUCENE-2570:

    Attachment: LUCENE-2570.patch

Most of the patch is about replacing the calls to getRandomMultiplier w/ the static constant
reference. All tests pass, except the one that is fixed in LUCENE-2568 (but not committed
yet). Unless you have more comments, I'd like to commit this shortly.

> Some improvements to _TestUtil and its usage
> --------------------------------------------
>                 Key: LUCENE-2570
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Test
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>             Fix For: 4.0
>         Attachments: LUCENE-2570.patch
> I've started this issue because I've noticed that _TestUtil.getRandomMultiplier() is
called from many loops' condition check, sometimes hundreds and thousands of times. Each time
it does Integer.parseInt after calling System.getProperty. This really can become a constant
IMO, either in LuceneTestCase(J4) or _TestUtil, as it's not expected to change while tests
are running ...
> I then reviewed the class and spotted some more things that I think can be fixed/improved:
> # getTestCodec() can become a constant as well
> # arrayToString is marked deprecated. I've checked an no one calls them, so I'll delete
them. This is a 4.0 code branch + a test-only class. No need to deprecate anything.
> # getTempDir calls new Random(), instead of newRandom() in LuceneTestCaseJ4, which means
that if something fails, we won't know the random seed used ...
> #* In that regard, we might want to output all the classes that obtained a static seed
in reportAdditionalFailures(), instead of just the class that ran the test.
> # rmDir(String) can be removed IMO, and leave only rmDir(File)
> # I suggest we include some recursion in rmDir(File) to handle the deletion of nested
> #* Also, it does not check whether the dir deletion itself succeeds (but it does so for
the files). This can bite us on Windows, if some test did not close things properly.
> I'll work out a patch.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message