Re: svn commit: r1371478 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolrJ.java

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1371478 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolrJ.java

Dawid Weiss-2
> -    Random r = new Random();
> +    Random r = new Random(0);

If you really want a local Random why not make it depend on the
current real seed?

Random r = new Random(random().nextLong());

Just curious -- why not just:

Random r = random()?

D.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1371478 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolrJ.java

Yonik Seeley-2-2
On Thu, Aug 9, 2012 at 4:57 PM, Dawid Weiss <[hidden email]> wrote:
>> -    Random r = new Random();
>> +    Random r = new Random(0);
>
> If you really want a local Random why not make it depend on the
> current real seed?

If anything, I'd rather have it the same each time.  It's more for
performance testing against externally started servers.
But now that you point it out, this is per-thread, so I should use a
seed of "base" so each thread gets different random docs (but still
the same each time).

-Yonik
http://lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1371478 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolrJ.java

Dawid Weiss
> If anything, I'd rather have it the same each time.  It's more for
> performance testing against externally started servers.
> But now that you point it out, this is per-thread, so I should use a
> seed of "base" so each thread gets different random docs (but still
> the same each time).

Ok, thanks.

D.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]