Code Review Request: 7197662: (prefs) java/util/prefs/ fails by timeout or by "couldn't get file lock"

Weijun Wang at
Sat Sep 22 09:23:10 UTC 2012

Correct, so it depends on how the system properties are used.

In my area, sometimes a system property is always re-read so it's safe 
to run related tests in agentvm. Sometimes it's read at initialization 
time and a static field is set, if there is no way to reset that static 
field, your tests might have to run in othervm mode.


On 09/22/2012 05:18 PM, Alan Bateman wrote:
> On 22/09/2012 00:12, Weijun Wang wrote:
>> I think jtreg would automatically reset any changed system property so
>> othervm is not necessary. Have you tried running it with other tests
>> in agentvm mode? Thanks Max
> There are many areas in the JDK where system properties are read once
> during initialization and that fixes the configuration for the lifetime
> of the VM. I think java.util.prefs.userRoot is one of them. Tests that
> set any of these properties are usually better run in their own VM
> because they can cause side effects for tests that run subsequently in
> the same VM. Such issues can be difficult to track down, we had quite a
> few of these when trying to get the tests to run in samevm or agentvm mode.
> So you are right that jtreg could unset these properties before running
> the next test but unless it knows whether the property is only read once
> or not then I don't think it will be reliable.
> -Alan.

More information about the core-libs-dev mailing list