[jdk8u-dev] RFR: JDK-8292998: Clean Secmod temporary NSS DB directory before test execution

Martin Balao mbalao at openjdk.org
Mon Aug 29 21:02:56 UTC 2022


On Mon, 29 Aug 2022 18:06:20 GMT, zzambers <duke at openjdk.org> wrote:

>> Hello,
>> 
>> I'd like to propose this fix as described in https://bugs.openjdk.org/browse/JDK-8292998
>> 
>> The temporary directory used by Secmod tests to copy NSS DB files is deleted (which includes all its files and, potentially, subdirectories) and created empty again before running the test. I decided to implement the recursive delete function here for 3 reasons: 1) it's a short and simple function,  2) convenience (we don't have to link every current Secmod test to a test library) and 3) increase chances of backporting future Secmod tests cleanly. Contrary to the approach of setting a minimum jtreg version required, the scope of this change are Secmod tests only and the risk should be minimal.
>> 
>> Thanks,
>> Martin.-
>
> I wonder why "DBDIR" is created inside of "test.classes" dir. Apart from not being cleaned up this also seems like potential source of problems when tests are run concurrently. Couldn't "DBDIR" just be placed in "scratch" [1] directory? Or is there something I am missing here?
> 
> [1] https://openjdk.org/jtreg/faq.html#scratch-directory

Hi @zzambers ,

It's a good point. I think that Secmod tests are not and have never been ready to run in parallel, at least not in 8u. As an example, they copy entire files to the same location without any file system synchronization scheme, which can potentially lead to inconsistencies. What we have fixed here is the sequential run of these tests, which was working before JDK-8195607.

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

PR: https://git.openjdk.org/jdk8u-dev/pull/115


More information about the jdk8u-dev mailing list