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

Alan Bateman Alan.Bateman at oracle.com
Sat Sep 22 09:18:10 UTC 2012


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