lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] [Updated] (LUCENE-4212) Tests should not use new Random() without args
Date Wed, 11 Jul 2012 18:13:36 GMT


Robert Muir updated LUCENE-4212:

    Attachment: LUCENE-4212.patch

Another buggy case in the MockRandomPostingsFormat: today we do sometimes use the no-arg ctor
at write time
(should only be used for read!), specifically if you use -Dtests.postingsformat=MockRandom

This results in unseeded behavior, not good. With the previous patch you get NPE (a little

Updated patch throws IAE in this case, and I fixed LuceneTestCase to pass the seed to MockRandom
if you use this -D option.

> Tests should not use new Random() without args
> ----------------------------------------------
>                 Key: LUCENE-4212
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/build
>            Reporter: Robert Muir
>         Attachments: LUCENE-4212.patch, LUCENE-4212.patch, LUCENE-4212.patch
> They should be using random() etc, and if they create one, it should pass in a seed.
> Otherwise, they probably won't reproduce.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


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

View raw message