RFR (XS) 8202360: [TESTBUG] runtime/LoadClass/TestResize.java needs to print output when it fails

Gerard Ziemski gerard.ziemski at oracle.com
Thu May 17 16:21:43 UTC 2018

hi David,

Thank you for the review!

> On May 16, 2018, at 4:54 PM, David Holmes <david.holmes at oracle.com> wrote:
> Hi Gerard,
> On 17/05/2018 3:47 AM, Gerard Ziemski wrote:
>> Hi all,
>> Please review this small enhancement where we print out additional information (i.e. output from PrintSystemDictionaryAtExit), when we detect the failure.
>> https://bugs.openjdk.java.net/browse/JDK-8202360
>> http://cr.openjdk.java.net/~gziemski/8202360_rev1/
> I don't understand what your fix is doing - sorry.

The fix takes all the available output bytes from the process (using Scanner to grab all tokens at once) and prints all the output from the process (i.e. PrintSystemDictionaryAtExit, and there is a lot of it) at failure. 

> What I wanted to see was the complete history of lines of the form
> "Java dictionary (table_size=107, classes=6)"
> so that we can see how the table size and number of classes have changed leading up to the failure. But I realize now that we already get that from the:
> System.out.println("PASS table_size:"+table_size+", classes:"+classes+" OK");
> All that is missing is the printing of the table_size and classes when we throw the exception. That can be trivially fixed:
>         if (loadFactor > MAX_LOAD_FACTOR) {
> +          System.out.println("FAIL table_size:"+table_size+", classes:"+classes);
>           throw new RuntimeException("Load factor too high, expected MAX "+MAX_LOAD_FACTOR+", got "+loadFactor);
>         } else {
>           System.out.println("PASS table_size:"+table_size+", classes:"+classes+" OK");
>         }

OK, so you determined that only that one piece of info was missing in the end in your case, but maybe the next person might want to see everything that PrintSystemDictionaryAtExit provides?

As long as we’re touching the test - should we then stick with the solution that prints out everything from PrintSystemDictionaryAtExit?


More information about the hotspot-runtime-dev mailing list