Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test utility methods to get attach API information #4639

Merged
merged 1 commit into from
Feb 12, 2019

Conversation

pdbain-ibm
Copy link
Contributor

@pdbain-ibm pdbain-ibm commented Feb 7, 2019

Add methods to check for attach API initialization, get process ID, and get
virtual machine ID.

Use reflection to avoid compile-time dependency on OpenJ9 internal classes by tests.
Replace some existing references to AttachHandler in favour of the new methods.

This is further to "Use reflection to access attach API internal APIs" #2962. This allows tests to remove references to attach API implementation classes and compile without requiring --add-exports java.base/com.ibm.tools.attach.target.

This is cleanup in preparation for tests of new features in #4655.

Signed-off-by: Peter Bain peter_bain@ca.ibm.com

@pdbain-ibm
Copy link
Contributor Author

pdbain-ibm commented Feb 7, 2019

This is cleanup in preparation for anticipated new attach API tests arising from #2543.

@pshipton
Copy link
Member

pshipton commented Feb 7, 2019

@pdbain-ibm the description doesn't seem to match the code. I thought this was going to be vm changes but it is all test changes. Is the change as intended?

Also, I think we need an Issue that each PR can refer to, so all the attach and utility changes can be tied together.

@pdbain-ibm pdbain-ibm changed the title Add methods to get attach API information Add test utility methods to get attach API information Feb 7, 2019
@pdbain-ibm
Copy link
Contributor Author

pdbain-ibm commented Feb 7, 2019

@pshipton This is cleaning up some very old Attach API test code that relied on access to implementation classes and made compilation difficult.

There is no issue at present, though I expect to use these utilities for testing #2377,
#4650, et al. Possibly @llxia should review this?

@pshipton
Copy link
Member

pshipton commented Feb 7, 2019

Please fix the commit title as well.

@pshipton
Copy link
Member

pshipton commented Feb 7, 2019

The Issue I'm thinking of is for jps, jstack, etc. There should be a high level issue and every related PR should refer to it.

@llxia
Copy link
Contributor

llxia commented Feb 8, 2019

jenkins test all xlinux jdk8,jdk11

@llxia
Copy link
Contributor

llxia commented Feb 8, 2019

jenkins test all xlinux jdk11

@llxia
Copy link
Contributor

llxia commented Feb 8, 2019

jenkins test sanity xlinux jdk11

@llxia
Copy link
Contributor

llxia commented Feb 8, 2019

jenkins test extended xlinux jdk11

@pshipton
Copy link
Member

pshipton commented Feb 8, 2019

@pdbain-ibm while the changes themselves look fine, com.ibm.tools.attach.target.AttachHandler is still hard coded. I assume you are planning additional changes later that will cause this change to make sense?

@pdbain-ibm
Copy link
Contributor Author

@pshipton This is further to "Use reflection to access attach API internal APIs" #2962. This allows tests to remove references to attach API implementation classes and compile without requiring --add-exports java.base/com.ibm.tools.attach.target.

@pshipton
Copy link
Member

pshipton commented Feb 8, 2019

It would be clearer if that information was in the commit comment and description of this PR.

Add methods to check for attach API initialization, get process ID, and get
virtual machine ID.

Use reflection to avoid compile-time dependency in test code on OpenJ9 internal
classes Replace some existing references to AttachHandler in favour of the new
methods.

This is further to "Use reflection to access attach API internal APIs" eclipse-openj9#2962.
This allows tests to remove references to attach API implementation classes and
compile without requiring `--add-exports
java.base/com.ibm.tools.attach.target`.

This is preparation for tests of new features in eclipse-openj9#4655.

[ci skip]

Signed-off-by: Peter Bain <peter_bain@ca.ibm.com>
@pdbain-ibm
Copy link
Contributor Author

It would be clearer if that information was in the commit comment and description of this PR.

Done.

@pshipton
Copy link
Member

@smlambert lgtm

@smlambert smlambert merged commit c4bd873 into eclipse-openj9:master Feb 12, 2019
@smlambert
Copy link
Contributor

smlambert commented Feb 12, 2019

I have merged this, however, jdk8/jdk11 grinders 276/278 eventually failed, am assuming missing native test libs, as I did not upload them to the job:

org.openj9.test.attachAPI.TestAttachAPI.test_agntld02
org.openj9.test.attachAPI.TestAttachAPI.test_agntld01
org.openj9.test.attachAPI.TestAttachAPI.test_agntld03

[AttachApiTest] [ERROR] com.sun.tools.attach.AgentLoadException: ATTACH_ERR AgentLoadException jvmtitest:
at com.ibm.tools.attach.attacher.OpenJ9VirtualMachine.parseResponse(OpenJ9VirtualMachine.java:326)
at com.ibm.tools.attach.attacher.OpenJ9VirtualMachine.loadAgentLibrary(OpenJ9VirtualMachine.java:244)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants