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

Fix: make test outputs TEST SUCCESS after unsuccessful exit

    XMLWordPrintable

Details

    • b16

    Backports

      Description

        `make test` outputs `TEST SUCCESS` after unsuccessful exit of JVM. One example is bad VM flags.

        I now have a reproducer for something that has puzzled me before (and most of my co-workers I think):

        // first test uses -XX:+UseG1GC second and third uses -XX:+UseG1GCC (sic)
        `make clean run-test TEST=open/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java JTREG='JAVA_OPTIONS=-XX:+UseG1GC'` -> OK
        `make run-test TEST=open/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java JTREG='JAVA_OPTIONS=-XX:+UseG1GCC'` -> OK
        `rm -rf test-results/jtreg_open_test_hotspot_jtreg_gc_arguments_TestCompressedClassFlags_java`
        `make run-test TEST=open/test/hotspot/jtreg/gc/arguments/TestCompressedClassFlags.java JTREG='JAVA_OPTIONS=-XX:+UseG1GCC'` -> FAIL

        The problem is that the success of the first test run seems to be cached and the second test-run seems to reuse the result of the first run.

        This seems to fix the problem:
        ```
        diff --git a/make/RunTests.gmk b/make/RunTests.gmk
        index 25dcdbb083d..489c3f839f8 100644
        --- a/make/RunTests.gmk
        +++ b/make/RunTests.gmk
        @@ -864,6 +864,7 @@ define SetupRunJtregTestBody

           clean-workdir-$1:
                $$(RM) -r $$($1_TEST_SUPPORT_DIR)
        + $$(RM) -r $$($1_TEST_RESULTS_DIR)

           $1_COMMAND_LINE := \
               $$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
        ```

        Attachments

          Issue Links

            Activity

              People

                lkorinth Leo Korinth
                lkorinth Leo Korinth
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: