<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 4/29/15 1:14 PM, Dmitry Fazunenko
      wrote:<br>
    </div>
    <blockquote cite="mid:55411182.70805@oracle.com" type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      Derek,<br>
      <br>
      @requires is a quite new feature of jtreg. It's used in the cases
      when a test should  not be executed in certain circumstances.<br>
      The most typical use case if a test runs VM with a one GC, and
      another GC is specified on the command line. <br>
      <br>
      <div class="moz-cite-prefix">On 29.04.2015 19:58, Derek White
        wrote:<br>
      </div>
      <blockquote cite="mid:55410DB4.8030007@oracle.com" type="cite">
        <meta content="text/html; charset=utf-8"
          http-equiv="Content-Type">
        <div class="moz-cite-prefix">Hi Dima,<br>
          <br>
          Thanks for the info. I looked briefly at using @requires but
          couldn't quite make sense of it. I definitely prefer have all
          of the info in the test, rather than modifying some random
          file elsewhere.<br>
          <br>
          So I understand<tt> @requires vm.gc=="null"</tt> means require
          all collectors to be implemented. <br>
        </div>
      </blockquote>
      It means, that the test uses all collectors, and if a collector is
      specified on command line the test (one of its @run) will fail
      with <br>
      Example: <span class="new">gc/TestSmallHeap.java</span><br>
      <blockquote cite="mid:55410DB4.8030007@oracle.com" type="cite">
        <div class="moz-cite-prefix"> <br>
          What does <tt>@requires vm.gc == "G1" | vm.gc == null"</tt>
          mean?<br>
        </div>
      </blockquote>
      It means that test should work if either G1 is given on command
      line (-vmoptions:-XX:+UseG1GC) or no collector specified.<br>
    </blockquote>
    <br>
    OK, this is getting interesting.<br>
    <br>
    So most of these tests use ProcessBuilder to specify a command line,
    and explicitly mention a GC to use. A single test might actually run
    each collector (gc/logging/TestGCId, for example). Does @requires
    matter in this case? <br>
    <br>
    Oh, maybe they should all have @requires vm.gc=="null", becuase the
    actual test is ignoring GC passed in by the test harness GC and
    running as a separate process anyway. It's misleading if the harness
    said UseG1GC and the test was actually running UseParallelGC, for
    example.<br>
    <br>
    FYI, it sounds like my original problem does require the exclude
    lists to keep the embedded JVM from running GC tests that it
    shouldn't.<br>
    <br>
     - Derek<br>
    <blockquote cite="mid:55411182.70805@oracle.com" type="cite">
      <blockquote cite="mid:55410DB4.8030007@oracle.com" type="cite">Is
        this documented somewhere?<br>
      </blockquote>
      <br>
      It's documented in jtreg:<br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://jre.us.oracle.com/java/re/jtreg/4.1/promoted/latest/binaries/jtreg/doc/jtreg/tag-spec.html">http://jre.us.oracle.com/java/re/jtreg/4.1/promoted/latest/binaries/jtreg/doc/jtreg/tag-spec.html</a><br>
      <br>
      Thanks,<br>
      Dima<br>
      <br>
      <br>
      <blockquote cite="mid:55410DB4.8030007@oracle.com" type="cite">
        <div class="moz-cite-prefix"> <br>
          Thanks!<br>
          <br>
           - Derek<br>
          <br>
          p.s. It turns out that TestDynamicNumberOfGCThreads and
          TestSmallHeap use <tt>@requires vm.gc=="null".</tt><br>
        </div>
      </blockquote>
      <br>
      <br>
      <br>
      <blockquote cite="mid:55410DB4.8030007@oracle.com" type="cite">
        <div class="moz-cite-prefix"> <br>
          On 4/29/15 12:25 PM, Dmitry Fazunenko wrote:<br>
        </div>
        <blockquote cite="mid:554105DE.70601@oracle.com" type="cite">
          <meta content="text/html; charset=utf-8"
            http-equiv="Content-Type">
          Hi Derek,<br>
          <br>
          Sorry for the late comment.<br>
          <br>
          Adding needs_XXXgc groups was a temporary solution for the
          period when jtreg didn't support @requires.<br>
          Those groups are not used anymore in our nightly runs and will
          be removed soon. <br>
          <br>
          The more proper way to specify that a test is not applicable
          for a certain collector is adding @requires tag.<br>
          Like:<br>
          * @requires vm.gc == "G1" | vm.gc == null<br>
          or<br>
          if a test use all collectors:<br>
           * @requires vm.gc=="null"<br>
          <br>
          Thanks,<br>
          Dima<br>
          <br>
          <div class="moz-cite-prefix">On 29.04.2015 18:00, Derek White
            wrote:<br>
          </div>
          <blockquote cite="mid:5540F209.9040700@oracle.com" type="cite">
            <meta content="text/html; charset=utf-8"
              http-equiv="Content-Type">
            <div class="moz-cite-prefix">Thanks Eric!<br>
              <br>
              On 4/29/15 10:44 AM, Eric Caspole wrote:<br>
            </div>
            <blockquote cite="mid:5540EE43.6060101@oracle.com"
              type="cite">
              <meta content="text/html; charset=utf-8"
                http-equiv="Content-Type">
              Hi Derek,<br>
              Looks good to me.<br>
              And now I learned how TEST.groups works ;)<br>
              Eric<br>
              <br>
              <br>
              <div class="moz-cite-prefix">On 4/28/2015 5:31 PM, Derek
                White wrote:<br>
              </div>
              <blockquote cite="mid:553FFC31.8030101@oracle.com"
                type="cite">
                <meta http-equiv="content-type" content="text/html;
                  charset=utf-8">
                Please review this simple for GC tests that require
                certain collectors (e.g. shouldn't run in embedded).<br>
                <br>
                Certain GC regression tests require specific collectors
                to be enabled in the JVM (by using -XX:+UseParallelGC,
                etc). But these tests were not listed in TEST.groups.<br>
                <br>
                This webrev adds the following tests to the appropriate
                needs_g1gc, needs_serialgc, needs_parallelgc, and
                needs_cmsgc lists.
                <ul>
                  <li>gc/TestSmallHeap.java</li>
                  <li>gc/TestCardTablePageCommits.java</li>
                  <li>gc/arguments/TestParallelHeapSizeFlags.java
                    gc/ergonomics/TestDynamicNumberOfGCThreads.java</li>
                  <li>gc/logging/TestGCId.java</li>
                </ul>
                CR:<br>
                <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="https://bugs.openjdk.java.net/browse/JDK-8078673">https://bugs.openjdk.java.net/browse/JDK-8078673</a><br>
                <br>
                Webrev:<br>
                <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://cr.openjdk.java.net/%7Edrwhite/8078673/webrev.00/">http://cr.openjdk.java.net/~drwhite/8078673/webrev.00/</a><br>
                <br>
                Testing: <br>
                JPRT<br>
                <br>
                Thanks,<br>
                 - Derek</blockquote>
            </blockquote>
          </blockquote>
        </blockquote>
      </blockquote>
    </blockquote>
  </body>
</html>