Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-10129

Forward module-related options when launching test subprocesses

    XMLWordPrintableJSON

Details

    Description

      Several tests and test helpers launch JVMs to run Geode code. For tests to run properly on JDK 17, that code must open or export the packages needed by the code that will run in the JVMs.

      Such helpers include:

      • GfshCommandRule
      • ProcessManager for DUnit tests.
      • ServerContainer for Jetty/Tomcat session tests.

      Also, ServerLauncherDUnitTest launches JVMs via a ProcessBuilder.

      A simple way to support opening and exporting the required packages is:

      1. Assume that the current JVM opened and exported all required packages. (See https://issues.apache.org/jira/browse/GEODE-10128)
      2. Query the -add-opens and add-exports that were used to launch the current JVM. This can be done by calling ManagementFactory.getRuntimeMXBean().getInputArguments(), then filtering the list to retain only the add-opens and -add-exports options.
      3. Add those options when launching a subprocess.

      It would be useful to query and perform the current JVM a single place. I propose a static method: JavaModuleHelper.getJvmModuleOptions().

      Attachments

        Issue Links

          Activity

            People

              demery Dale Emery
              demery Dale Emery
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: