[8] RFR 8028377: test/sun/security/provider/KeyStore/DKSTest.sh attempts to write to ${test.src}
Chris Hegarty
chris.hegarty at oracle.com
Wed Nov 20 12:03:59 UTC 2013
On 19/11/13 22:34, Vincent Ryan wrote:
> Hello Valerie,
>
> They get written to the scratch directory for the testrun so I
> don't think it is necessary to delete them explicitly.
> I'll confirm that.
You are correct Vinnie. Jtreg will attempt to delete the scratch working
directory after the test completes. You can leave things as are.
If you do want to explicitly remove these files, then you should use
something like FileUtils.deleteFileIfExistsWithRetry() [1]. If left to
jtreg, it has its own retry logic on Windows.
-Chris.
[1]
http://hg.openjdk.java.net/jdk8/tl/jdk/file/19d2e9649138/test/lib/testlibrary/jdk/testlibrary/FileUtils.java
>
> Thanks.
>
> On 19/11/2013 21:58, Valerie (Yu-Ching) Peng wrote:
>>
>> If the test passed, these temporary files should be removed, shouldn't
>> they?
>> Thanks,
>> Valerie
>>
>> On 11/19/13 07:29, Vincent Ryan wrote:
>>>
>>> On 19/11/2013 14:30, Weijun Wang wrote:
>>>> Why not just put the file in the current directory? That's the real
>>>> scratch dir. Or the cfg file needs an absolute path?
>>>
>>> Good point Max. The cfg file does require an absolute path so I've
>>> changed the test to now write to {user.dir}.
>>>
>>> And I've updated the webrev (in place).
>>>
>>>
>>>>
>>>> Also, is it necessary to remove the files in finally? If the test
>>>> fails,
>>>> the files will be retained by jtreg so we can look into the reason. Or,
>>>> these lines are added to make sure the files are removable? But then I
>>>> think File::delete will not fail if a file is not removable.
>>>> Files::delete is better.
>>>
>>> I previously encountered a problem when tests were running concurrently
>>> but now that I write to {user.dir} I can remove that finally block.
>>>
>>>
>>>>
>>>> Thanks
>>>> Max
>>>>
>>>>
>>>> On 11/19/13, 22:16, Vincent Ryan wrote:
>>>>> Please review the following test fix:
>>>>>
>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8028377
>>>>> Webrev: http://cr.openjdk.java.net/~vinnie/8028377/webrev.00/
>>>>>
>>>>> It now writes temporary keystores in the test scratch area
>>>>> (not the test source area).
>>>>>
>>>>> Thanks.
>>
More information about the security-dev
mailing list