--- old/test/hotspot/jtreg/runtime/logging/ModulesTest.java 2020-07-22 12:00:45.928340827 -0700 +++ new/test/hotspot/jtreg/runtime/logging/ModulesTest.java 2020-07-22 12:00:45.748334051 -0700 @@ -34,13 +34,18 @@ import jdk.test.lib.process.ProcessTools; public class ModulesTest { + // If modules in the system image have been archived in CDS, no Modules will + // be dynamically created at runtime. Disable CDS so all of the expected messages + // are printed. + private static String XSHARE_OFF = "-Xshare:off"; + public static void main(String[] args) throws Exception { - testModuleTrace("-Xlog:module=trace", "-version"); - testModuleLoad("-Xlog:module+load", "-version"); - testModuleUnload("-Xlog:module+unload", "-version"); + testModuleTrace("-Xlog:module=trace", XSHARE_OFF, "-version"); + testModuleLoad("-Xlog:module+load", XSHARE_OFF, "-version"); + testModuleUnload("-Xlog:module+unload", XSHARE_OFF, "-version"); // same as -Xlog:module+load -Xlog:module+unload - testModuleLoad("-verbose:module", "-version"); + testModuleLoad("-verbose:module", XSHARE_OFF, "-version"); } static void testModuleTrace(String... args) throws Exception {