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

Claes Redestad claes.redestad at oracle.com
Tue Jan 9 21:15:59 UTC 2018


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