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

Remove Jdk9SigTestDriver #623

Merged
merged 5 commits into from
Mar 5, 2021

Conversation

brideck
Copy link
Contributor

@brideck brideck commented Feb 26, 2021

The Jdk9SigTestDriver class has a lot of unimplemented function to the point where it is broken for many use cases when testing with Java 11 (see #618 for details). This PR will remove that class and amend everywhere that uses it.

In its place, I'm adding calls to jimage to extract the modules needed for the sig tests and updating sigTestClasspath to match.

TO DO:

CC @alwin-joseph @anajosep @arjantijms @cesarhernandezgt @dblevins @m0mus @edbratt @gurunrao @jansupol @jgallimore @kazumura @kwsutter @LanceAndersen @bhatpmk @RohitKumarJain @gthoman

@alwin-joseph
Copy link
Contributor

Should we set a default option for jimage.dir so even if missed to set it, there wont be test failures.

@brideck
Copy link
Contributor Author

brideck commented Feb 26, 2021

Should we set a default option for jimage.dir so even if missed to set it, there wont be test failures.

Yes, I should have pointed that out in the TO DOs, too. I didn't know the default env enough to presume what a sensible value would be.

@brideck
Copy link
Contributor Author

brideck commented Mar 1, 2021

I would humbly suggest something like ${ts.home}/jdk-bundles as a sensible default. Thoughts?

@alwin-joseph
Copy link
Contributor

alwin-joseph commented Mar 2, 2021

I would humbly suggest something like ${ts.home}/jdk-bundles as a sensible default. Thoughts?

Hi Brian, yes the above does make sense. Other possible options I feel are ${java.home}/extract/classes , ${ts.home}/tmp/jdk-bundles/

@alwin-joseph
Copy link
Contributor

* The standalone sig tests also need updated ts.jte.jdk11 files, but I don't have an easy way to run them and therefore don't know what the right set of modules is to have on sigTestClasspath for each of them.

${JAVA_HOME}/extract/classes/java.base${pathsep}${JAVA_HOME}/extract/classes/java.naming${pathsep}${JAVA_HOME}/extract/classes/java.rmi${pathsep}${JAVA_HOME}/extract/classes/java.sql

The above added to sigTestClasspath should resolve it for platform TCK . I think the same can be used for standalone TCKs too to resolve most of the required packages.

@brideck
Copy link
Contributor Author

brideck commented Mar 2, 2021

Okay, I think I'm going to use the ${ts.home}/tmp location that you proposed yesterday. Even though most of this stuff is containerized, I don't think I want to plant the idea of putting it in a more permanent location.

Updates to the PR on their way.

@brideck
Copy link
Contributor Author

brideck commented Mar 2, 2021

@alwin-joseph

I've updated all of the ts.jte.jdk11 files with new values. What do we need to do to merge and/or test out these changes?

@alwin-joseph
Copy link
Contributor

@alwin-joseph

I've updated all of the ts.jte.jdk11 files with new values. What do we need to do to merge and/or test out these changes?

I ran some of the tests using this change in the CI

https://ci.eclipse.org/jakartaee-tck/blue/organizations/jenkins/jakartaee-tck-alw/detail/RemoveJdk9SigTestDriver/8/pipeline/52 .

Looks like we get below error , maybe we need to create the directory/ set permissions before ?

[javatest.batch] 03-02-2021 21:03:45: jimage extract --dir=/home/jenkins/agent/workspace/_tck-alw_RemoveJdk9SigTestDriver/annotations-tck/bin/xml/../../tmp/jdk-bundles /opt/jdk-11.0.7/lib/modules
[javatest.batch] 03-02-2021 21:03:45: Exception while executing JImage! Some tests may fail.
[javatest.batch] java.io.IOException: Cannot run program "jimage": error=2, No such file or directory

You can also test caj tck in local with this change.

  1. Run docker/build_standalonetck.sh caj (to build caj tck)
  2. Run docker/cajtck.sh (after setting jdk = jdk11)

@brideck
Copy link
Contributor Author

brideck commented Mar 2, 2021

Hrm. I do create the jimage.dir ahead of time, so I don't think that's it.

It's not actually executing jimage at all, otherwise I think the output would look different. I think it's complaining that it doesn't know what/where jimage is. Perhaps I need to pass the full path to jimage as the command? Curiously, I did not need that when testing locally in my OL environment.

@brideck
Copy link
Contributor Author

brideck commented Mar 2, 2021

@alwin-joseph
Update made. Can we please try another spin of the tests?

@alwin-joseph
Copy link
Contributor

@alwin-joseph
Update made. Can we please try another spin of the tests?

Early results of annotations show pass https://ci.eclipse.org/jakartaee-tck/job/jakartaee-tck-alw/job/RemoveJdk9SigTestDriver/9/.
Running more tcks now at https://ci.eclipse.org/jakartaee-tck/job/jakartaee-tck-alw/job/RemoveJdk9SigTestDriver/10

@brideck
Copy link
Contributor Author

brideck commented Mar 3, 2021

Running more tcks now at https://ci.eclipse.org/jakartaee-tck/job/jakartaee-tck-alw/job/RemoveJdk9SigTestDriver/10

Excellent, thanks. Those are looking pretty darn good, if I don't say so myself.

@alwin-joseph
Copy link
Contributor

alwin-joseph commented Mar 3, 2021

jaspic has Missing classes : looks like jakarta.authentication-api.jar is needed to be in the sigTestClasspath.
logs: https://ci.eclipse.org/jakartaee-tck/blue/rest/organizations/jenkins/pipelines/jakartaee-tck-alw/branches/RemoveJdk9SigTestDriver/runs/10/nodes/57/steps/164/log/?start=0

rest of tcks ran at https://ci.eclipse.org/jakartaee-tck/job/jakartaee-tck-alw/job/RemoveJdk9SigTestDriver/11/

jpa : Looks like there is a recent change that you are missing , can you try getting latest from master
logs https://ci.eclipse.org/jakartaee-tck/blue/rest/organizations/jenkins/pipelines/jakartaee-tck-alw/branches/RemoveJdk9SigTestDriver/runs/11/nodes/56/steps/178/log/?start=0

saaj has missing classes error : (webservices-api-osgi.jar)
logs : https://ci.eclipse.org/jakartaee-tck/blue/rest/organizations/jenkins/pipelines/jakartaee-tck-alw/branches/RemoveJdk9SigTestDriver/runs/11/nodes/61/steps/182/log/?start=0

jta is handled differently from sigtests. Yet to check
logs : https://ci.eclipse.org/jakartaee-tck/blue/rest/organizations/jenkins/pipelines/jakartaee-tck-alw/branches/RemoveJdk9SigTestDriver/runs/11/nodes/60/steps/185/log/?start=0

jstl has missing classes : https://github.com/eclipse-ee4j/jakartaee-tck/blob/b75718b4de57e36b85f103402f185dfb509f56c1/docker/jstltck.sh#L80 is overriding the sigtestclasspath in ts.jte(.jdk11). We can keep them in the ts.jte & ts.jte.jdk11 , remove from jstltck.sh

logs : https://ci.eclipse.org/jakartaee-tck/blue/rest/organizations/jenkins/pipelines/jakartaee-tck-alw/branches/RemoveJdk9SigTestDriver/runs/11/nodes/59/steps/196/log/?start=0

jsp has missing classes : It seems the docker/jsptck.sh is overriding the sigtestclasspath in ts.jte(.jdk11) . I suggest we can remove the line https://github.com/eclipse-ee4j/jakartaee-tck/blob/b75718b4de57e36b85f103402f185dfb509f56c1/docker/jsptck.sh#L73 from docker/jsptck.sh and keep them in the ts.jte & ts.jte.jdk11
logs : https://ci.eclipse.org/jakartaee-tck/blue/rest/organizations/jenkins/pipelines/jakartaee-tck-alw/branches/RemoveJdk9SigTestDriver/runs/11/nodes/58/steps/176/log/?start=0

Others look good to me.

@brideck
Copy link
Contributor Author

brideck commented Mar 3, 2021

Some of these failures imply that these weren't tested for EE 9, right? I mean, jakarta.authentication-api.jar being missing for jaspic seems like a pretty fundamental problem unrelated to the changes in this PR.

But sure, let's try to fix them all. Changes forthcoming...

@alwin-joseph
Copy link
Contributor

Some of these failures imply that these weren't tested for EE 9, right? I mean, jakarta.authentication-api.jar being missing for jaspic seems like a pretty fundamental problem unrelated to the changes in this PR.

For 9.0 we used ts.jte which has the right CP. We probably copied the ts.jte.jdk11 from ts.jte before adding the jar.

- Update to use jimage for JDK 11+ runs
- Create new jimage.dir property for use in sig tests

Signed-off-by: Brian Decker <bmdecker@us.ibm.com>
Signed-off-by: Brian Decker <bmdecker@us.ibm.com>
@brideck
Copy link
Contributor Author

brideck commented Mar 3, 2021

For 9.0 we used ts.jte which has the right CP. We probably copied the ts.jte.jdk11 from ts.jte before adding the jar.

Ah, of course. It's apparently too early in the morning to think of such things.

I've fixed jaspic, saaj, jsp, & jstl, and I've rebased to try to fix jpa, if you want to retry those.

Not sure what's going on with jta. It looks like the test applications aren't getting deployed.

@alwin-joseph
Copy link
Contributor

For 9.0 we used ts.jte which has the right CP. We probably copied the ts.jte.jdk11 from ts.jte before adding the jar.

Ah, of course. It's apparently too early in the morning to think of such things.

I've fixed jaspic, saaj, jsp, & jstl, and I've rebased to try to fix jpa, if you want to retry those.

Not sure what's going on with jta. It looks like the test applications aren't getting deployed.

https://ci.eclipse.org/jakartaee-tck/blue/organizations/jenkins/jakartaee-tck-alw/detail/RemoveJdk9SigTestDriver/14/pipeline/51

jsp : I think jakarta.el.jar is missing in the CP
can add el.classes to sigTestClasspath
logs : https://ci.eclipse.org/jakartaee-tck/blue/rest/organizations/jenkins/pipelines/jakartaee-tck-alw/branches/RemoveJdk9SigTestDriver/runs/14/nodes/51/steps/101/log/?start=0

saaj : looks like I was wrong, webservices-api-osgi.jar is already there in the CP. I suspect java.xml module is needed.
logs : https://ci.eclipse.org/jakartaee-tck/blue/rest/organizations/jenkins/pipelines/jakartaee-tck-alw/branches/RemoveJdk9SigTestDriver/runs/14/nodes/49/steps/103/log/?start=0

Signed-off-by: Brian Decker <bmdecker@us.ibm.com>
@brideck
Copy link
Contributor Author

brideck commented Mar 3, 2021

What is hopefully the last set of fixes has been pushed. Fixes for jsp & saaj, as well as updates to ts.jte for jsp/jstl since we are no longer writing out a new value for sigTestClasspath.

Copy link
Contributor

@alwin-joseph alwin-joseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

// on the testcase's classpath.
Properties sysProps = System.getProperties();
String version = (String) sysProps.get("java.version");
if (version.startsWith("11")) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to just do this for Java 9 and above to future proof this and not require a future change for later JDKs.

if (!version.startsWith("1.")) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until we solve #156 (stop checking JDK signatures) we are dependent on specific Java SE versions. Although whether all future JDKs will work with this code change, I'm not sure.

My current thinking is that we will need to switch to checking if the Java version is equal/greater than the current base Java SE version (after we solve jakartaee-tck/issues/156). If that makes sense, we will be saying that the TCK can work with any later JDK version as long as the later JDK version doesn't break compatibility with what the TCK depends on. In summary, I think that is the best possible and might mean that a particular TCK version only really works with the base Java SE version + the next N JDK versions until some (later JDK) breaking change causes breakage. So, that later JDK version will not work with the earlier TCK until a new TCK (for a new Jakarta EE release) is released that works with the new JDK version. This is just my current thinking and the community, you, others need to buy into it when we actually look to resolve jakartaee-tck/issues/156. Sorry for the interruption and tangent on this pr. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone ahead and made Jared's proposed changes. Even if we move forward with changes related to 156, making this change would remove the need for us to update the driver code for this particular scenario again.

// on the testcase's classpath.
Properties sysProps = System.getProperties();
String version = (String) sysProps.get("java.version");
if (version.startsWith("11")) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as the previous one to do ! startsWith "1."

Copy link
Contributor

@gurunrao gurunrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are failures with JDK8 + Glassfish 6 + (PR changes) combination. jimage.dir property not set in ts.jte error.
Details can be found here -
https://ci.eclipse.org/jakartaee-tck/job/guru/job/jakartaee-tck-gtest/job/RemoveJdk9SigTestDriver/2/

@alwin-joseph
Copy link
Contributor

There are failures with JDK8 + Glassfish 6 + (PR changes) combination.
Details can be found here -
https://ci.eclipse.org/jakartaee-tck/job/guru/job/jakartaee-tck-gtest/job/RemoveJdk9SigTestDriver/2/

Good catch. I think a default value should be set for jimage.dir in all ts.jte files also or via java source code.

@brideck
Copy link
Contributor Author

brideck commented Mar 4, 2021

There are failures with JDK8 + Glassfish 6 + (PR changes) combination.
Details can be found here -
https://ci.eclipse.org/jakartaee-tck/job/guru/job/jakartaee-tck-gtest/job/RemoveJdk9SigTestDriver/2/

Good catch. I think a default value should be set for jimage.dir in all ts.jte files also or via java source code.

Interesting. I'm not sure exactly what drives the property checking exception being reported here. Would it also just work to move String jimageDir = testInfo.getJImageDir(); inside the if (version.startsWith("11")) block? It would be nice to not have to set a dummy value in all of the ts.jte files that will literally never be used.

@brideck
Copy link
Contributor Author

brideck commented Mar 4, 2021

Interesting. I'm not sure exactly what drives the property checking exception being reported here. Would it also just work to move String jimageDir = testInfo.getJImageDir(); inside the if (version.startsWith("11")) block? It would be nice to not have to set a dummy value in all of the ts.jte files that will literally never be used.

It does look like it's the call to getProperty() in SigTestData that is triggering it, per the code here: https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/src/com/sun/ts/lib/deliverable/AbstractPropertyManager.java#L211

Interestingly, we're actually trying to use this other getProperty() method that can set a default for a missing property: https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/src/com/sun/ts/lib/deliverable/AbstractPropertyManager.java#L228

But that method will literally never work right, since it just defers to the version that errors in the case of null. I think I will actually fix the getProperty() call to try to give us the expected/useful behavior here.

This doesn't seem to be 100% correct, and I can't quite figure out the code flow at play here. I'll just try a simpler more specific change for the first pass fix attempt.

Signed-off-by: Brian Decker <bmdecker@us.ibm.com>
@brideck
Copy link
Contributor Author

brideck commented Mar 4, 2021

@gurunrao

I've pushed a fix that works with Java 8 for me locally, if you could verify through another attempt that would be great.

@gurunrao
Copy link
Contributor

gurunrao commented Mar 4, 2021

@gurunrao

I've pushed a fix that works with Java 8 for me locally, if you could verify through another attempt that would be great.

@brideck - thanks for helping us with fixes, I have triggered new build here - https://ci.eclipse.org/jakartaee-tck/job/guru/job/jakartaee-tck-gtest/job/RemoveJdk9SigTestDriver/3/

@brideck
Copy link
Contributor Author

brideck commented Mar 4, 2021

Oof. That apparently did not actually work. Digging some more in an attempt to avoid editing dozens of ts.jte files to add an unused property.

Signed-off-by: Brian Decker <bmdecker@us.ibm.com>
@brideck
Copy link
Contributor Author

brideck commented Mar 4, 2021

@gurunrao

Once more, please. I tested the previous attempt incorrectly, but this one really does seem to fix it locally.

@gurunrao
Copy link
Contributor

gurunrao commented Mar 5, 2021

@gurunrao
Copy link
Contributor

gurunrao commented Mar 5, 2021

@brideck have restarted the build - https://ci.eclipse.org/jakartaee-tck/job/guru/job/jakartaee-tck-gtest/job/RemoveJdk9SigTestDriver/4/

Tests are passing now with JDK8 + GF 6 + PR.

@brideck
Copy link
Contributor Author

brideck commented Mar 5, 2021

Tests are passing now with JDK8 + GF 6 + PR.

Excellent. If there are no more objections at this point, I think this PR could safely be merged by someone.

@scottmarlow scottmarlow merged commit 0ca652b into jakartaee:master Mar 5, 2021
@scottmarlow
Copy link
Contributor

Thanks @brideck for making this change! I'll soon start a build via https://ci.eclipse.org/jakartaee-tck/job/9.1/job/eftl-jakartaeetck-build-910/ and then later start a test run via https://ci.eclipse.org/jakartaee-tck/job/9.1/job/eftl-jakartaeetck-run-910/

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

Successfully merging this pull request may close these issues.

None yet

5 participants