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

Shared Classes Cache / AOT Testing #3774

Closed
dsouzai opened this issue Nov 21, 2018 · 12 comments
Closed

Shared Classes Cache / AOT Testing #3774

dsouzai opened this issue Nov 21, 2018 · 12 comments
Labels

Comments

@dsouzai
Copy link
Contributor

dsouzai commented Nov 21, 2018

This issue (epic) will track the plan for improving Shared Classes Cache (SCC) / AOT Testing.

Enable more Shared Classes Test modes

One of the best tests we have is the shared classes test found here https://github.com/eclipse/openj9-systemtest/tree/master/openj9.test.sharedClasses . It internally has 5 tests and 25 different modes; some of these modes look like they're either irrelevant or out of date, but effectively there are at least a couple hundred different tests that could be run. Unfortunately, the systemtest playlist only runs 8 of these. @smlambert and @llxia are working towards enabling extra modes in this test bucket.

Update Shared Classes Test to run twice

https://github.com/eclipse/openj9-systemtest/blob/master/openj9.test.sharedClasses/src/test.sharedClasses/net/openj9/stf/SharedClasses.java#L245-L253 will need to be modified to be invoked twice. The problem with the sharedClasses test right now is that even though there are 5 JVMs invoked, which means that some JVMs will load AOT code compiled by a different JVM, it doesn't fully test the AOT load infrastructure becuase after the test is completed, the SCC gets destroyed before the next test runs.

EDIT: This has been addressed by adoptium/openj9-systemtest#54

Augment non SCC/AOT Tests for SCC/AOT verification

Existing Tests can be augmented to verify the SCC / AOT infrastructure and generated code. The general approach would be modifying existing tests in the following way:

  1. Destroy SCC
  2. Run Test (this will be the AOT compile run)
  3. Run Test some number of times (this will be the AOT load run)
  4. Destroy SCC

AOT/SCC PR Testing

#4875

Fix AOT/SCC PR Tests Failures

#6057


fyi @smlambert @llxia @mstoodle @andrewcraik

@dsouzai
Copy link
Contributor Author

dsouzai commented Nov 21, 2018

I'll tackle the "Update Shared Classes Test to run twice" task; it looks like a relatively simple problem that I (as someone with no experience in the test infrastructure) can address :)

@andrewcraik
Copy link
Contributor

@dsouzai So in relation to #3752 do we expect to have some basic shared classes testing available in the next few days that we can use to test the pull requests this item will entail. Pull request a in the sequence is open pending testing and I was hopiong we could use some of the work described here to do that, but that requires this to be available sooner rather than later.

@dsouzai
Copy link
Contributor Author

dsouzai commented Nov 21, 2018

So in relation to #3752 do we expect to have some basic shared classes testing available in the next few days that we can use to test the pull requests this item will entail.

Yeah I believe so (assuming the "Updated Shared Classes Test to run twice" change I'll have soon gets merged quickly); The systemTest bucket already has SCC tests (https://github.com/AdoptOpenJDK/openjdk-tests/blob/master/systemtest/playlist.xml#L725-L923) which can be used for testing so my change should improve the coverage provided by these existing tests.

@dsouzai
Copy link
Contributor Author

dsouzai commented Nov 21, 2018

I'm not sure if these tests can be triggered from a PR though; that's something an infra person would know.

dsouzai pushed a commit to dsouzai/openj9-systemtest that referenced this issue Nov 21, 2018
The problem with the sharedClasses test right now is
that even though there are 5 JVMs invoked, which means
that some JVMs will load AOT code compiled by a different
JVM, it doesn't fully test the AOT load infrastructure
becuase after the test is completed, the SCC gets
destroyed before the next test runs. This commit addresses
this issue by invoking the test twice; once to primarily
populate the SCC, and a second time to primarily load
from it.

eclipse-openj9/openj9#3774

Signed-off-by: Irwin D'Souza <[email protected]>
@andrewcraik
Copy link
Contributor

@AdamBrousseau or @smlambert do you know the answer to the above about triggering these improved SCC tests from a PR - since there are going to be > 26 of them made over the next week or two having the tests available would be a big help (see the merge plan in #3752)

@llxia
Copy link
Contributor

llxia commented Nov 21, 2018

No, we donot have PR build for system tests at this point. However, you can run a grinder build by changing the following file to point into your own branch.
https://github.com/AdoptOpenJDK/openjdk-tests/blob/7f959e7be0ea44844918dc1e65949aef8939764a/systemtest/build.xml#L99

@AdamBrousseau
Copy link
Contributor

PR support for system tests will come in #2836

@llxia
Copy link
Contributor

llxia commented Nov 22, 2018

PR support for system tests (#2836) works for changes in openj9 repo.
I do not think it will work for changes in the system test repos (i.e., https://github.com/eclipse/openj9-systemtest or https://github.com/AdoptOpenJDK/openjdk-systemtest).

@jdmpapin
Copy link
Contributor

However, you can run a grinder build by changing the following file to point into your own branch [...]

Changing that line looks like it would affect the version of openj9-systemtest used for testing, but I don't have a branch of openj9-systemtest. Rather, I'm modifying openj9 itself. So I suppose the way to run the tests is as a grinder, but with no need to edit the linked file—is that right? If so, where can I find instructions for running a grinder?

@llxia
Copy link
Contributor

llxia commented Nov 22, 2018

Changing that line looks like it would affect the version of openj9-systemtest used for testing, but I don't have a branch of openj9-systemtest. Rather, I'm modifying openj9 itself. So I suppose the way to run the tests is as a grinder, but with no need to edit the linked file—is that right? If so, where can I find instructions for running a grinder?

Yes, you can grinder for any type of tests. Or PR build for functional for now.
Link to How-to-Run-a-Grinder-Build-on-Jenkins
#3697 (comment) has more detail in terms of testing in case you are interested

In general, what test to run really depends on what is your change.

@smlambert
Copy link
Contributor

Related work:

  1. Flush SCC prior to each test target run - Add test setUp/tearDown to TKG #3950
  2. Set correct options, run tests X number of iterations (default X=2) - Support AOT testing #4096

With the above 2 pieces of work, a committer can now run a Grinder against particular/individual test targets with the TEST_FLAG=AOT. The committer at this point should assess the TEST_TARGET as to whether it is appropriate to run (some tests in the sanity or extended target are not applicable).

Last step is to tag tests so that the ones that are not relevant or appropriate to run multiple times are skipped if trying to run under AOT test flag. After this is done, then running the higher level targets like the sanity.functional target will make sense.

@dsouzai
Copy link
Contributor Author

dsouzai commented Jul 28, 2020

Closing this as the general infrastructure has been in place for a while now.

@dsouzai dsouzai closed this as completed Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants