Correct "library" usage and concurrent use of scratch directory

David Holmes david.holmes at oracle.com
Mon Jun 29 12:40:05 UTC 2015


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


More information about the jtreg-use mailing list