JDK-8193497 : SA: Modify ClhsdbLauncher and other tests to throw errors on attach failures
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 10
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2017-12-14
  • Updated: 2019-02-01
  • Resolved: 2019-02-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The SA tests currently 'PASS' even though the test is 'skipped' due to attach permission issues. The SA tests execute the following snippet: (either directly in the test or indirectly through ClhsdbLauncher.java).

        if (!Platform.shouldSAAttach()) {
            // Silently skip the test if we don't have enough permissions to attach
            System.out.println("SA attach not expected to work - test skipped.");
            return null;
        }   
The tests have to be modified to throw an error (and not PASS) if there is an attach failure. Once this is done, the tests which consume the output from ClhsdbLauncher for further testing, should throw an exception if there is any null output from ClhsdbLauncher. It would make sense to do this in the caller of ClhsdbLauncher.run() since this would be test specific. 

At this point, the SA Mach5 tests on MacOS do not run (due to attach permission issues) since they are not invoked with root privileges due to an infra issue. (INFRA-12468)

So, due to the above issue, the SA tests on MacOSX would also have to be quarantined as a part of this fix till INFRA-12468 gets resolved.


Comments
Thanks for the suggestion, Igor. Currently making changes to throw SkippedException as a part of JDK-8217473. Closing this as a duplicate of JDK-8217473.
01-02-2019

after CODETOOLS-7901596, you can throw jtreg.SkippedException exception when !Platform.shouldSAAttach(), if this exception is properly propagated to jtreg (in other words, isn't swallowed by test logic), jtreg will report this test as a skipped (by a special sub-status) and our infra does support this sub-status and report it separately. see JDK-8208655, for examples on how other hotspots tests were updated to use this functionality.
31-01-2019