RFR: 8134459: java/util/stream/test/org/openjdk/tests/java/util/stream/WhileOpTest.java timed out

Roger Riggs Roger.Riggs at Oracle.com
Tue Jan 9 21:30:40 UTC 2018

Hi Claes,

Looks ok, a couple of nits.

line 57: Please break the long string to make future side-by-side 
reviews easier.

line 322:  Perhaps "Iterator contents differ" instead of "iterators 
differ" so its clear
the contents of the iterators are different, not the instances.

Having the indices might be useful for debugging, but they aren't ever 
supposed to be different.

Regards, Roger

On 1/9/2018 4:15 PM, Claes Redestad wrote:
> Hi,
> the 
> java/util/stream/test/org/openjdk/tests/java/util/stream/WhileOpTest.java 
> has
> started timing out locallty on my machine, and analyzing why it seems 
> it simply has
> added enough test cases recently to hit the default 120s timeout.
> Quickly analyzing what is taking so much time I ran into an 
> inefficiency in TestNGs
> assertEquals(Iterator<?>, Iterator<?>) implementation, where at least 
> one error message
> string is created unconditionally in an inner loop, leading to quite a 
> bit of allocation
> pressure in a test like WhileOpTest.
> On my machine, avoiding this extra work speeds up the test from taking 
> around ~130s
> to ~100s. A good improvement, but still somewhat close to the default 
> 120s timeout.
> So as a fix I propose:
> - work around this by providing simplified assert methods in the 
> LambdaTestHelper that
> avoid the excessively allocating methods in TestNG
> - increasing the timeout of WhileOpTest to 240s
> http://cr.openjdk.java.net/~redestad/8134459/open.00/
> Regards
> /Claes

More information about the core-libs-dev mailing list