RFR 8021883 j.u.Random/RandomStream.java test needs more robust timeout duration

Chris Hegarty chris.hegarty at oracle.com
Tue Jul 30 16:25:17 UTC 2013


On 07/30/2013 05:14 PM, Paul Sandoz wrote:
> On Jul 30, 2013, at 4:57 PM, Chris Hegarty <chris.hegarty at oracle.com> wrote:
>> Paul,
>>
>> 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.

Ah ok, got it.

> In fact it would be clearer to do:
>
>    int rc = cfs.stream().map(CompletableFuture::join).distinct().count();
>    assertEquals(rc, tasks);

This would be a little more obvious ( to me ).

-Chris.

>
> Paul.
>



More information about the core-libs-dev mailing list