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

[testbug] TestJmapCore failing without SA: introduce @requires vm.hasSAandCanAttach

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • 11
    • hotspot
    • None
    • b20

        Tests using the serviceability agent SA fail on platforms where SA is not implemented (aix, s390).
        Currently this is TestJmapCore*.

        Such tests can be guarded at runtime by checking Platform.shouldSAAttach().
        This checks two things: whether SA is imlemented on the platform (if not, returns false) and whether SA can attach to the VM in the current environment (sometimes root privileges are needed).

        If SA is not implemented it would be better to not even start the test. This can be achieved by a @requires statement in the test description. This is more efficient and more obvious then only skipping the test at execution time.

        This change introduces @requires attribute vm.hasSA and vm.hasSAandCanAttach.
        vm.hasSA is true on platforms where SA is port (all but aix and s390).
        vm.hasSAandCanAttach is true if SA is ported and can attach to the VM.

        The implementation of Platform.shouldSAAttach() is refactored accordingly.

        Tests are adapted to use @requires where feasible.

              goetz Goetz Lindenmaier
              goetz Goetz Lindenmaier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: