RFR: 8295153: java/util/Base64/TestEncodingDecodingLength.java ran out of memory [v2]

Lance Andersen lancea at openjdk.org
Wed May 1 20:29:54 UTC 2024


On Wed, 1 May 2024 20:12:33 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> Justin Lu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Reflect review comments
>
> test/jdk/java/util/Base64/TestEncodingDecodingLength.java line 75:
> 
>> 73:         } catch (InvocationTargetException ex) {
>> 74:             Throwable rootEx = ex.getCause();
>> 75:             assertEquals(OutOfMemoryError.class, rootEx.getClass(), "00ME should be thrown");
> 
> Sorry if it is intentional, but I wonder if you meant "OOME" instead of "00ME" here?

Good catch, you sometimes see what you want to see

> test/jdk/java/util/Base64/TestEncodingDecodingLength.java line 100:
> 
>> 98:             m.invoke(DECODER, src, -LARGE_MEM_SIZE + 1, 1);
>> 99:         } catch (InvocationTargetException ex) {
>> 100:             fail("Decode should neither throw NASE or OOME: " + ex.getCause());
> 
> Should we check the cause is either NASE or OOME here?

The original test just validated there was no exception thrown, so I think we can just update the message to indicate an unexpected Exception.

I had added this as a comment but must have missed hitting the comment button

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19036#discussion_r1586789013
PR Review Comment: https://git.openjdk.org/jdk/pull/19036#discussion_r1586788635


More information about the core-libs-dev mailing list