RFR (L): 8068685 - [TESTBUG] Ensure @library works in jtreg -agentvm mode

David Holmes david.holmes at oracle.com
Wed Feb 25 04:55:36 UTC 2015


On 25/02/2015 6:45 AM, George Triantafillou wrote:
> Please review this fix for JDK-8068685:
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8068685
> webrev: http://cr.openjdk.java.net/~gtriantafill/8068685/webrev.00
> <http://cr.openjdk.java.net/%7Egtriantafill/8068685/webrev.00>
>
> "@build com.oracle.java.testlibrary.*" was added to all relevant tests,

I thought we had an RFE open against jtreg to avoid the need to do this, 
but it seems I was mistaken. :(

Most of the additions to @build seem okay. A few minor issues:

--- old/test/compiler/whitebox/ForceNMethodSweepTest.java	2015-02-24 
10:31:03.991071066 -0800
+++ new/test/compiler/whitebox/ForceNMethodSweepTest.java	2015-02-24 
10:31:03.617052982 -0800
@@ -35,6 +35,9 @@
   * @test
   * @bug 8059624 8064669
   * @library /testlibrary /../../test/lib
+ * @build com.oracle.java.testlibrary.* ForceNMethodSweepTest
+ * @ignore 8066998
+ * @library /testlibrary /../../test/lib
   * @build ForceNMethodSweepTest

The second @library shouldn't have been added.

--- old/test/gc/g1/TestStringSymbolTableStats.java	2015-02-24 
10:32:28.209143019 -0800
+++ new/test/gc/g1/TestStringSymbolTableStats.java	2015-02-24 
10:32:27.855125901 -0800
@@ -22,11 +22,13 @@
   */

  /*
- * @test TestStringSymbolTableStats.java
+ * @test TestStringSymbolTableStats

Why did you change the @test? I see a lot of unchanged @test foo.java.


> which resulted in longer test execution times.  In order to offset these
> longer test execution times and to support running jtreg in -agentvm
> mode, the following changes were made:
>
> test/Makefile: added -agentvm option

I'm unclear exactly what this buys us - do we just save on the startup 
costs of new vms running jtreg? I thought the default was samevm anyway?

Also does this mean that all VMs will share a single copy of the 
testlibrary or will we still have a copy per test that gets built each time?

> test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java: added
> -classpath since -agentvm passes the classpath differently than -othervm
>
> *Testing shows an 11% speed improvement for JPRT execution of the
> hotspot testset, and a 48% speed improvement for
> hotspot_runtime*/gc*/compiler*/serviceability* tests.**
>
> *Note that some tests required the explicit addition of -othervm in
> order for the tests to pass.  In addition, a number of gc, compiler and
> runtime tests were modified with @run so they would run successfully
> with -agentvm.  Consequently, reviews from members of the compiler, gc,
> runtime, and serviceability teams would be very helpful.

I'm unclear about the need for some of the othervm changes. I would only 
expect othervm to be needed if passing -XX options via @run ??

Thanks,
David

> Thanks to Erik Helin for providing a solution for passing classpath with
> -agentvm.
>
> The fix was tested locally on Linux with jtreg and on all platforms with
> the JPRT hotspot testset.*
> *
> Thanks.
>
> -George
>


More information about the hotspot-runtime-dev mailing list