Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8069343

Improve gc/g1/TestHumongousCodeCacheRoots.java to use jtreg @requires

XMLWordPrintable

    • gc
    • b06

        The test in gc/g1/TestHumongousCodeCacheRoots.java makes sure to run with a client and server VM by spawning VMs with -client/-server parameters respectively.

        When a particular type of VM is not supported, the code currently checks on failure whether this was because of unsupported compiler mode and if so, just suppresses the failing result.

        A cleaner way of doing that would be to split the test into two tests, each @require'ing the particular vm flavor. And having a @run tag using -client/-server respectively. Then jtreg would supposedly not even run the test with the non-supported VM, and the setup code for spawning the extra processes could go away.

        E.g.

        // client test:
        @...
        @requires vm.flavor == client
        @run main -client TestHumongousCodeCacheRootsClient

        class TestHumongousCodeCacheRootsClient {
          public static void main(String[] args) {
            TestHumongousCodeCacheRootsHelper.main(args); // put into an
        auxiliary class file...
          }
        }

        // server test:
        @...
        @requires vm.flavor == client
        @run main -client TestHumongousCodeCacheRootsServer

        class TestHumongousCodeCacheRootsServer {
          public static void main(String[] args) {
            TestHumongousCodeCacheRootsHelper.main(args); // put into an
        auxiliary class file...
          }
        }

              jcbeyler Jean Christophe Beyler
              tschatzl Thomas Schatzl
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: