Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7901438

Multiple @requires tags in jtreg tests

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • tools
    • None
    • generic
    • generic

      The jtreg documentation (http://openjdk.java.net/jtreg/tag-spec.html) says

        "The @requires tag may be used at most once in a given test."

      The following tests contain multiple @requires tags (the number at the end of the line indicates the number of such tags).

      ./hotspot/test/closed/runtime/AppCDS/ArchiveSize.java 2
      ./hotspot/test/closed/runtime/AppCDS/WithoutUnlockFlag.java 3
      ./hotspot/test/closed/gc/cmm/TestHeapUnderMemoryPressure.java 2
      ./hotspot/test/gc/TestSmallHeap.java 3
      ./jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java 3

      Empirically, it looks like multiple @requires tags are effectively and'ed, which is what one would expect if multiple tags were permitted. But I haven't tested that extensively, and since the documentation says only one is permitted, empirical testing doesn't really mean much.

      Either these tests need to be fixed, or the jtreg documentation should be updated and the implementation verified that it really does support multiple @requires tags. Since multiple @requires tags seems more readable and since the implementation *appears* to already support that, I suggest the documentation should be updated. Hence my filing of this bug against jtreg rather than the tests.

      Also, if only one @requires tag is to be permitted, then there should be a check for more, to eliminate the risk of further tests with multiple tags being added.

            Unassigned Unassigned
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: