JDK-8217777 TEST_BUG: jdk/java/util/prefs/ExportSubtree.java passes even when test should fail

Roger Riggs Roger.Riggs at oracle.com
Mon Jan 28 16:19:16 UTC 2019


Looks good,

Thanks, Roger

On 01/28/2019 10:49 AM, Langer, Christoph wrote:
> Hi Steve, Roger,
>
> I made some additional cleanups in the test (Declare constants final, formatting, nice up error output...)
>
> This is what ran through our test system without issues: http://cr.openjdk.java.net/~clanger/webrevs/8217777.0/
>
> In case there was an error in the output, it would read like this:
>
> ----------System.out:(39/1030)----------
> Preferences::exportSubtree did not yield the expected result.
> Actual:
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd">
> <preferences EXTERNAL_XML_VERSION="1.0">
>    <root type="user">
>      <map/>
>      <node name="testExportSubtree">
>        <map>
>          <entry key="key2" value="value2"/>
>        </map>
>        <node name="test">
>          <map>
>            <entry key="key3" value="value3"/>
>          </map>
>        </node>
>      </node>
>    </root>
> </preferences>
>
> Expected:
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd">
> <preferences EXTERNAL_XML_VERSION="1.0">
>    <root type="user">
>      <map/>
>      <node name="testExportSubtree">
>        <map>
>          <entry key="key2" value="value2"/>
>        </map>
>        <node name="test">
>          <map>
>            <entry key="key3" value="value3"/>
>          </map>
>        </node>
>      </node>
>    </root>
> </preferences>d
>
> Are you all ok with that? Then I'd push it...
>
> Thanks
> Christoph
>
>
>> -----Original Message-----
>> From: core-libs-dev <core-libs-dev-bounces at openjdk.java.net> On Behalf
>> Of Roger Riggs
>> Sent: Freitag, 25. Januar 2019 17:52
>> To: Steve Groeger <GROEGES at uk.ibm.com>
>> Cc: core-libs-dev at openjdk.java.net
>> Subject: Re: JDK-8217777 TEST_BUG: jdk/java/util/prefs/ExportSubtree.java
>> passes even when test should fail
>>
>> +1,
>>
>> Thanks, Roger
>>
>>
>> On 01/25/2019 11:21 AM, Steve Groeger wrote:
>>> Hi Roger,
>>>
>>> Thanks. Have included the bug number to the @bug line and have
>>> included the expected and actual output when there is an error.
>>>
>>> Have generated a new webrev here:
>>> http://cr.openjdk.java.net/~sgroeger/8217777/webrev.01/
>>> <http://cr.openjdk.java.net/%7Esgroeger/8217777/webrev.01/>
>>>
>>> Hope this is now OK.
>>>
>>> Thanks
>>> Steve Groeger
>>> IBM Runtime Technologies
>>> Hursley, Winchester
>>> Tel: (44) 1962 816911  Mobex: 279990  Mobile: 07718 517 129
>>> Fax (44) 1962 816800
>>> Lotus Notes: Steve Groeger/UK/IBM
>>> Internet: groeges at uk.ibm.com
>>>
>>> Unless stated otherwise above:
>>> IBM United Kingdom Limited - Registered in England and Wales with
>>> number 741598.
>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
>>> 3AU
>>>
>>>
>>>
>>> From: Roger Riggs <Roger.Riggs at oracle.com>
>>> To: core-libs-dev at openjdk.java.net
>>> Date: 25/01/2019 15:30
>>> Subject: Re: JDK-8217777 TEST_BUG:
>>> jdk/java/util/prefs/ExportSubtree.java passes even when test should fail
>>> Sent by: "core-libs-dev" <core-libs-dev-bounces at openjdk.java.net>
>>> ------------------------------------------------------------------------
>>>
>>>
>>>
>>> Hi Steve,
>>>
>>> Add 8217777 to the @bug line; it helps track and run tests that fixed
>>> bugs  (jtreg -bug:8217777)
>>>
>>> +1 printing the expected and actual (when a failure occurs).
>>>
>>> Looks fine overall.
>>>
>>> Thanks, Roger
>>>
>>>
>>>
>>> On 01/25/2019 09:57 AM, Steve Groeger wrote:
>>>> Hi Christoph,
>>>>
>>>> Thanks for looking at this.
>>>>
>>>> These lines
>>>>
>>>> 43           //System.out.print(baos.toString());
>>>> 44           //System.out.print(expectedResult);
>>>>
>>>> were commented out in the current code but if you think displaying this
>>>> info would be good then I can un-comment them.
>>>>
>>>> I think only fixing this in the jdk (JDK13) branch is OK.
>>>> If it is later determined that this is really needed in jdk12 or
>>> jdk11u ,
>>>> then I can always request a backport.
>>>>
>>>> Thanks
>>>> Steve Groeger
>>>> IBM Runtime Technologies
>>>> Hursley, Winchester
>>>> Tel: (44) 1962 816911  Mobex: 279990  Mobile: 07718 517 129
>>>> Fax (44) 1962 816800
>>>> Lotus Notes: Steve Groeger/UK/IBM
>>>> Internet: groeges at uk.ibm.com
>>>>
>>>> Unless stated otherwise above:
>>>> IBM United Kingdom Limited - Registered in England and Wales with
>> number
>>>> 741598.
>>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
>>> PO6 3AU
>>>>
>>>>
>>>> From:   "Langer, Christoph" <christoph.langer at sap.com>
>>>> To:     Steve Groeger <GROEGES at uk.ibm.com>
>>>> Cc:     core-libs <core-libs-dev at openjdk.java.net>
>>>> Date:   25/01/2019 14:30
>>>> Subject:        RE: JDK-8217777 TEST_BUG:
>>>> jdk/java/util/prefs/ExportSubtree.java passes even when test should fail
>>>>
>>>>
>>>>
>>>> Hi Steve,
>>>>
>>>> in general this change looks reasonable to me.
>>>>
>>>> I think in case there is an error, it would be useful to get a
>>> printout of
>>>> the expected/vs actual strings like these lines:
>>>> 43           //System.out.print(baos.toString());
>>>> 44           //System.out.print(expectedResult);
>>>>
>>>> I'll take the change and run it through our test system and see if
>>> we see
>>>> any issues.
>>>>
>>>> Is it ok for you if we do the fix just in the jdk branch (JDK13) or are
>>>> you particularly interested in getting this fixed for jdk12 and/or
>>> jdk11u?
>>>> Best regards
>>>> Christoph
>>>>
>>>>> -----Original Message-----
>>>>> From: core-libs-dev <core-libs-dev-bounces at openjdk.java.net> On
>> Behalf
>>>>> Of Steve Groeger
>>>>> Sent: Freitag, 25. Januar 2019 12:40
>>>>> To: core-libs <core-libs-dev at openjdk.java.net>
>>>>> Subject: RFR: JDK-8217777 TEST_BUG:
>>>> jdk/java/util/prefs/ExportSubtree.java
>>>>> passes even when test should fail
>>>>>
>>>>> Hi all,
>>>>>
>>>>> I have found an issue with the jdk/java/util/prefs/ExportSubtree.java
>>>>> test.
>>>>> Using jtreg to run this test the test passes no matter what happens
>>>> within
>>>>> the test.
>>>>> Have raised an issue for this:
>>>>>
>>>> https://bugs.openjdk.java.net/browse/JDK-8217777
>>>>
>>>>> I think the issue is 2 fold:
>>>>> 1) the test check the expected vs. actual and throws an exception but
>>>> this
>>>>> is caught later in the code, which causes the test to pass as there is
>>>> no
>>>>> exception thrown.
>>>>> 2) the exported XML now contains a `standalone="no"` entry in the XML
>>>>> prologue, which is not in the expected XML.
>>>>>
>>>>> I have generated a webrev to resolve this:
>>>>>
>>>> http://cr.openjdk.java.net/~sgroeger/8217777/webrev.00/
>>> <http://cr.openjdk.java.net/%7Esgroeger/8217777/webrev.00/>
>>>>> This occurs on jdk11 but is probabaly also an issue on other
>>> releases ie
>>>>> jdk8u, jdk12, jdk  etc
>>>>>
>>>>> Please could someone review this webrev and sponsor this chnage for
>> me
>>>> as
>>>>> I am unable to commit this myself.
>>>>>
>>>>> Thanks
>>>>> Steve Groeger
>>>>> IBM Runtime Technologies
>>>>> Hursley, Winchester
>>>>> Tel: (44) 1962 816911  Mobex: 279990  Mobile: 07718 517 129
>>>>> Fax (44) 1962 816800
>>>>> Lotus Notes: Steve Groeger/UK/IBM
>>>>> Internet: groeges at uk.ibm.com
>>>>>
>>>>> Unless stated otherwise above:
>>>>> IBM United Kingdom Limited - Registered in England and Wales with
>>> number
>>>>> 741598.
>>>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
>> PO6
>>>>> 3AU
>>>>> Unless stated otherwise above:
>>>>> IBM United Kingdom Limited - Registered in England and Wales with
>>> number
>>>>> 741598.
>>>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
>> PO6
>>>>> 3AU
>>>>
>>>>
>>>> Unless stated otherwise above:
>>>> IBM United Kingdom Limited - Registered in England and Wales with
>> number
>>>> 741598.
>>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
>>> PO6 3AU
>>>
>>>
>>>
>>>
>>> Unless stated otherwise above:
>>> IBM United Kingdom Limited - Registered in England and Wales with
>>> number 741598.
>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
>> 3AU



More information about the core-libs-dev mailing list