[
https://issues.apache.org/jira/browse/LUCENE-5896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14186808#comment-14186808
]
Simon Willnauer commented on LUCENE-5896:
-----------------------------------------
[~dawidweiss] just merged a PR that might make this easier after all.... I had
similar problems in Elasticsearch leading to
https://github.com/carrotsearch/randomizedtesting/pull/177 which would allow
methods like this:
{code}
public static IndexWriterConfig newIndexWriterConfig(long seed) {
return RandomizedContext.current().runWithPrivateRandomness(new
Randomness(seed), new Callable<IndexWriterConfig>() {
@Override
public IndexWriterConfig call() throws Exception {
return newIndexWriterConfig(); // delegate to the ordinary method
}
});
}
{code}
it's not the simplest solution but it's way less error prone
> A few potential reproducibility issues
> --------------------------------------
>
> Key: LUCENE-5896
> URL: https://issues.apache.org/jira/browse/LUCENE-5896
> Project: Lucene - Core
> Issue Type: Test
> Components: general/test
> Affects Versions: 4.9
> Reporter: Simon Willnauer
> Fix For: 4.10, Trunk
>
> Attachments: LUCENE-5896.patch
>
>
> I realized that passing the same seeded random instance to LuceneTestCase#
> newIndewWriterConfig doesn't necessarily produce the same IWC and I found a
> bunch of issues in that class using global random rather than local random.
> Yet, I went over the file to spot others but we might need to think about a
> more automated way to spot those...
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]