You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shai Erera (JIRA)" <ji...@apache.org> on 2010/07/27 16:29:16 UTC

[jira] Resolved: (LUCENE-2570) Some improvements to _TestUtil and its usage

     [ https://issues.apache.org/jira/browse/LUCENE-2570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shai Erera resolved LUCENE-2570.
--------------------------------

    Fix Version/s: 3.1
       Resolution: Fixed

Committed revision 979646 (trunk).
Committed revision 979720 (3x).

> Some improvements to _TestUtil and its usage
> --------------------------------------------
>
>                 Key: LUCENE-2570
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2570
>             Project: Lucene - Java
>          Issue Type: Test
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>             Fix For: 3.1, 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 directories.
> #* 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org