From jonathan.gibbons at oracle.com Thu Jul 16 22:43:07 2015 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 16 Jul 2015 15:43:07 -0700 Subject: Correct "library" usage and concurrent use of scratch directory In-Reply-To: <55913CA5.5090305@oracle.com> References: <55913CA5.5090305@oracle.com> Message-ID: <55A8337B.4010807@oracle.com> On 06/29/2015 05:40 AM, David Holmes wrote: > Hi, > > We have a test that sometimes fails with a ClassNotFoundException: > test.Empty. Here's the file structure: > > runtime/Metaspace/ > classes/test/Empty.java > FragmentMetaspace.java > FragmentMetaspaceSimple.java > > And here's the test directives from the failing > FragmentMetaspaceSimple.java: > > /** > * @test > * @library /runtime/testlibrary > * @library classes > * @build test.Empty ClassUnloadCommon > * @run main/othervm/timeout=200 FragmentMetaspaceSimple > */ > > Does this look right? > > I've only reproduced the failure when running both tests in the > Metaspace directory. And locally when that happens TraceExceptions > shows me that the Classloader can't find the JTwork/scratch/./classes > directory. > > The other test is specified as: > > /** > * @test > * @library /runtime/testlibrary > * @modules java.compiler > * @build GeneratedClassLoader > * @run main/othervm/timeout=200 -Xmx300m FragmentMetaspace > */ > > will they both try to manipulate the scratch directory? > > Thanks, > David I'm surprised by the reference to JTwork/scratch/./classes. @library classes should map to JTwork/classes/runtime/Metaspace/classes. jtreg should not itself be manipulating anything in the scratch directory, except to ensure that it is empty immediately before the test starts, and (optionally) to retain any files written in the scratch directory when the test completes. -- Jon