RFR JDK-8196748,tools/jar tests need to tolerate unrelated warnings

David Holmes david.holmes at oracle.com
Mon Mar 12 02:48:19 UTC 2018


Hi Sherman,

On 10/03/2018 8:34 AM, Xueming Shen wrote:
> Hi,
> 
> Please help codereview the change for JDK-8196748.
> 
> Issue: https://bugs.openjdk.java.net/browse/JDK-8196748
> webrev: http://cr.openjdk.java.net/~sherman/8196748/webrev
> 
> Those tests are based on parsing the std in/err of the jar command.
> It appears the "best wau" for now is to hardcode the filter to filter
> out the specific jvm warning msg case by case.

Thanks for working on this and adding the new functionality to 
OutputAnalyzer, but note that:

+   private static final String jvmwarningmsg =
+       "Java HotSpot\\(TM\\) 64-Bit Server VM warning:.*";

is Oracle JDK specific and 64-bit and server VM specific! Other tests use:

Pattern.compile(".*VM warning.*")

to exclude all VM warnings. Sorry that wasn't clear from previous 
discussions.

> Verified with the warning msg turned on as
> http://cr.openjdk.java.net/~sherman/8196748/webrev.hs/src/hotspot/share/runtime/arguments.cpp.sdiff.html
> and ran the jtreg with -XX:+FastTLABRefill.

That will not hit all cases as it requires the -XX:+FastTLABRefill to be 
passed through to all JVMs launched by tests. The original problem 
occurred with unconditional warnings that did not depend on a particular 
flag being specified on the command-line. All of those cases have now 
been fixed however so just reenabling the message doesn't achieve anything.

I tweaked the obsolete flag table to reintroduce the failure mode:

diff -r 2085742233ed src/hotspot/share/runtime/arguments.cpp
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -516,7 +516,7 @@
    { "VMThreadHintNoPreempt",        JDK_Version::jdk(11), 
JDK_Version::jdk(12), JDK_Version::jdk(13) },
    { "PrintSafepointStatistics",     JDK_Version::jdk(11), 
JDK_Version::jdk(12), JDK_Version::jdk(13) },
    { "PrintSafepointStatisticsTimeout", JDK_Version::jdk(11), 
JDK_Version::jdk(12), JDK_Version::jdk(13) },
-  { "PrintSafepointStatisticsCount",JDK_Version::jdk(11), 
JDK_Version::jdk(12), JDK_Version::jdk(13) },
+  { "PrintSafepointStatisticsCount",JDK_Version::jdk(10), 
JDK_Version::jdk(11), JDK_Version::jdk(13) },

    // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted 
by obsolete_in then expired_in:
    { "DefaultMaxRAMFraction",        JDK_Version::jdk(8), 
JDK_Version::undefined(), JDK_Version::undefined() },
@@ -739,7 +739,7 @@
        if (!version_less_than(JDK_Version::current(), flag.obsolete_in)) {
          if (Flag::find_flag(flag.name) != NULL) {
            // Temporarily disable the warning: 8196739
-          // warning("Global variable for obsolete special flag entry 
\"%s\" should be removed", flag.name);
+          warning("Global variable for obsolete special flag entry 
\"%s\" should be removed", flag.name);
          }
        }
      }
@@ -749,7 +749,7 @@
        if (!version_less_than(JDK_Version::current(), flag.expired_in)) {
          if (Flag::find_flag(flag.name) != NULL) {
            // Temporarily disable the warning: 8196739
-          // warning("Global variable for expired flag entry \"%s\" 
should be removed", flag.name);
+          warning("Global variable for expired flag entry \"%s\" should 
be removed", flag.name);
          }
        }
      }

> btw: tools/jar/LeadingGarbage.java is not failing in 11, so it is not 
> touched.

It fails with my patch above - as per the original bug report.

Thanks,
David

> Thanks,
> Sherman


More information about the core-libs-dev mailing list