8224145: Build compare script fails intermittently on test image native libraries
authorerikj
Thu, 23 May 2019 14:14:13 -0700
changeset 55018 ecb7b9a98f0e
parent 55017 5dc15cb1405c
child 55019 c55404ed4bd9
8224145: Build compare script fails intermittently on test image native libraries Reviewed-by: tbell
make/scripts/compare.sh
make/scripts/compare_exceptions.sh.incl
--- a/make/scripts/compare.sh	Thu May 23 14:13:09 2019 -0700
+++ b/make/scripts/compare.sh	Thu May 23 14:14:13 2019 -0700
@@ -820,6 +820,9 @@
             BIN_MSG="($BIN_MSG)"
             DIFF_BIN=
         fi
+    else
+        BIN_MSG=
+        DIFF_BIN=
     fi
 
     if [ -n "$STAT" ]; then
@@ -1571,15 +1574,12 @@
     fi
     if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
         echo -n "Test "
-        # Test native libs are never stripped so will not compare well.
-        SKIP_BIN_DIFF="true"
-        ACCEPTED_SMALL_SIZE_DIFF_bak="$ACCEPTED_SMALL_SIZE_DIFF"
-        if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
-            ACCEPTED_SMALL_SIZE_DIFF="true"
+        STRIP_ALL_bak="$STRIP_ALL"
+        if [ "$STRIP_TESTS_BEFORE_COMPARE" = "true" ]; then
+          STRIP_ALL="true"
         fi
         compare_all_libs $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
-        SKIP_BIN_DIFF="false"
-        ACCEPTED_SMALL_SIZE_DIFF="$ACCEPTED_SMALL_SIZE_DIFF_bak"
+        STRIP_ALL="$STRIP_ALL_bak"
     fi
     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
         compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
@@ -1593,10 +1593,12 @@
     fi
     if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
         echo -n "Test "
-        # Test native executables are never stripped so will not compare well.
-        SKIP_BIN_DIFF="true"
+        STRIP_ALL_bak="$STRIP_ALL"
+        if [ "$STRIP_TESTS_BEFORE_COMPARE" = "true" ]; then
+          STRIP_ALL="true"
+        fi
         compare_all_execs $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
-        SKIP_BIN_DIFF="false"
+        STRIP_ALL="$STRIP_ALL_bak"
     fi
     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
         compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
--- a/make/scripts/compare_exceptions.sh.incl	Thu May 23 14:13:09 2019 -0700
+++ b/make/scripts/compare_exceptions.sh.incl	Thu May 23 14:14:13 2019 -0700
@@ -40,6 +40,9 @@
       ./lib/server/libjvm.so
       ./hotspot/gtest/server/libjvm.so
       "
+  STRIP_BEFORE_COMPARE="
+      ./hotspot/gtest/server/libjvm.so
+      "
 elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
   SKIP_BIN_DIFF="true"
   SKIP_FULLDUMP_DIFF="true"
@@ -56,6 +59,7 @@
       ./lib/libfontmanager.so
       ./lib/libsaproc.so
   "
+  STRIP_TESTS_BEFORE_COMPARE="true"
 elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then
   SKIP_BIN_DIFF="true"
   SKIP_FULLDUMP_DIFF="true"
@@ -72,4 +76,5 @@
       ./lib/server/libjvm.dylib
       ./hotspot/gtest/server/libjvm.dylib
       "
+  STRIP_TESTS_BEFORE_COMPARE="true"
 fi