RFR 8021883 j.u.Random/RandomStream.java test needs more robust timeout duration
paul.sandoz at oracle.com
Tue Jul 30 16:14:11 UTC 2013
On Jul 30, 2013, at 4:57 PM, Chris Hegarty <chris.hegarty at oracle.com> wrote:
> This looks like a nice cleanup, as well as fixing the timeout issue.
> I just don't get the change in failure criteria. The old test used to verify that the arrays of random numbers of all generating threads were not equal, but now your checking the number of tasks?
Previously the first result was checked if it was distinct. Now it checks all results are unique: add results to a set, if results are distinct the size should be the same as the # tasks producing the results. Note i was carefully to replace arrays with lists to ensure equals by content not reference.
In fact it would be clearer to do:
int rc = cfs.stream().map(CompletableFuture::join).distinct().count();
More information about the core-libs-dev