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

Get Mail Platform TCK into a Runnable State #2097

Merged
merged 3 commits into from
Mar 20, 2025

Conversation

Pandrex247
Copy link
Contributor

@Pandrex247 Pandrex247 commented Mar 20, 2025

Fixes Issue
None that I could find

Related Issue(s)
None

Describe the change
Gets the Mail TCK into a runnable state, as it doesn't currently resolve.
This is done by removing an undefined (and redundant) property.
Also fixes an incorrect module name under glassfish-runner.

I've also removed the need to define the TS_HOME environment variable and set it to glassfish-runner/mail-platform-tck/jakartaeetck, as the runner doesn't seem to actually expect it to be variable? It uses this directory to find the certificates and config files.
To coincide with this, I have made a distinction between the home and work directories so that it does not leave config files the runner generates behind in there (which git is not configured to ignore).

Please correct me if this is in fact meant to be adjustable and I will remove those commits.

Additional context
I could not find an active Jenkins job for the Mail TCK in the Eclipse CI, I assume it is meant to be this one but it's inactive.
If there is one and everything is green please feel free to disregard this PR (and point me at where this is please!).

The TCK does not pass for me locally on Java 17 or 21, but it at least now runs.
A few tests pass, but then the TCK seems to hit some ClassNotFoundExceptions on its own test classes (for a yet to be discerned reason), and then hangs.

ClassNotFound:

03-20-2025 10:27:56:  TRACE: #######  Value of harness.socket.retry.count is "10"
03-20-2025 10:27:56:  TRACE: #######  Value of harness.log.port is "2000"
03-20-2025 10:27:56:  TRACE: #######  Actual bind value of harness.log.port is "2000"
03-20-2025 10:27:56:  TRACE: Check if called from within test process, inTestHarness= true
03-20-2025 10:27:56:  TRACE: in ServiceEETest.run(), this URL is:  file:/home/andrew/Git/Platform-TCK/glassfish-runner/mail-platform-tck/target/appclient/internetMimeMultipart_appclient_vehicle_client.jar
03-20-2025 10:27:56:  TRACE: VehicleClient URL is:  file:/home/andrew/Git/Platform-TCK/glassfish-runner/mail-platform-tck/target/appclient/internetMimeMultipart_appclient_vehicle_client.jar
03-20-2025 10:27:56:  TRACE: VehicleClient class check if is vehicle class =  yes, is a com.sun.ts.tests.common.vehicle.VehicleClient
03-20-2025 10:27:56:  TRACE: in ServiceEETest.run() method
03-20-2025 10:27:56:  TRACE: Vehicle to be used for this test is:  appclient
java.lang.NoClassDefFoundError: com/sun/ts/tests/javamail/ee/internetMimeMultipart/NullOutputStream
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:421)
        at java.base/java.lang.Class.forName(Class.java:412)
        at com.sun.ts.tests.common.vehicle.EmptyVehicleRunner.run(EmptyVehicleRunner.java:39)
        at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:119)
        at com.sun.ts.lib.harness.EETest.getPropsReady(EETest.java:440)
        at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:220)
        at com.sun.ts.lib.harness.EETest.run(EETest.java:254)
        at com.sun.ts.tests.common.vehicle.VehicleClient.main(VehicleClient.java:37)
Caused by: java.lang.ClassNotFoundException: com.sun.ts.tests.javamail.ee.internetMimeMultipart.NullOutputStream
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        ... 9 more
STATUS:Failed.Vehicle runner failed

Hang:

INFO: [APPCLIENT-out] ************************************************************
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd outputLineReceived
INFO: [APPCLIENT-out] * props file set to "/tmp/andrew-cts-props.txt"
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd outputLineReceived
INFO: [APPCLIENT-out] ************************************************************
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd outputLineReceived
INFO: [APPCLIENT-out] 03-20-2025 10:28:03:  TRACE: #######  Value of harness.socket.retry.count is "10"
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd outputLineReceived
INFO: [APPCLIENT-out] 03-20-2025 10:28:03:  TRACE: #######  Value of harness.log.port is "2000"
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd outputLineReceived
INFO: [APPCLIENT-out] 03-20-2025 10:28:03:  TRACE: #######  Actual bind value of harness.log.port is "2000"
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err] Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/ts/tests/javamail/ee/internetMimeMultipart/NullOutputStream
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err]   at java.base/java.lang.Class.forName0(Native Method)
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err]   at java.base/java.lang.Class.forName(Class.java:421)
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err]   at java.base/java.lang.Class.forName(Class.java:412)
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err]   at com.sun.ts.lib.harness.EETest.getPropsReady(EETest.java:424)
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err]   at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:220)
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err]   at com.sun.ts.lib.harness.EETest.run(EETest.java:254)
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err]   at com.sun.ts.tests.common.vehicle.VehicleClient.main(VehicleClient.java:37)
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err] Caused by: java.lang.ClassNotFoundException: com.sun.ts.tests.javamail.ee.internetMimeMultipart.NullOutputStream
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err]   at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err]   at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived
INFO: [APPCLIENT-err]   at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd errorLineReceived

Removes the redundant and undefined glassfish.toplevel.dir property and replaces the TS_HOME environment variable

Signed-off-by: Andrew Pielage <pandrex247@hotmail.com>
Signed-off-by: Andrew Pielage <pandrex247@hotmail.com>
Signed-off-by: Andrew Pielage <pandrex247@hotmail.com>
@scottmarlow scottmarlow requested a review from arjantijms March 20, 2025 14:07
@arjantijms
Copy link
Contributor

I could not find an active Jenkins job for the Mail TCK in the Eclipse CI, I assume it is meant to be this one but it's inactive.

There's been quite a few experiments with jobs and half done work. I'm not entirely sure why the "other" folder is there. I think we'd better move them to the folder that contains the work in progress jobs: https://ci.eclipse.org/jakartaee-tck/job/11/job/work-in-progress/

A while ago we refocused our attempts to get the TCK running on the web profile. Since Mail is obviously not in the web profile (afterall, which web application would ever send e-mail, the horror!), the Mail TCK was probably not completed and was left in an unknown state.

Mar 20, 2025 10:28:03 AM tck.arquillian.protocol.appclient.AppClientCmd outputLineReceived

As soon as you see any reference to "appclient", then typically all bets are off. Forget it, it won't run reliably. It's an arcance and ancient technology that nobody uses. I've mentioned it again and again, I honestly don't understand why we're even trying to get this to work.

The TCK does not pass for me locally on Java 17 or 21, but it at least now runs.

Most of the refactored TCKs initially don't pass all tests. They have been automatically refactored (using open rewrite) and there's all sorts of things the scripts get wrong. Inserting double slashes in URLs, not including some deployment descriptor, or adding a descriptor with the wrong name. The challenge is basically to find all of those errors and fix them.

@arjantijms
Copy link
Contributor

Big thanks for trying the Mail TCK though and for the initial fixes! Much appreciated :)

@arjantijms arjantijms merged commit 51e8fb8 into jakartaee:main Mar 20, 2025
2 checks passed
@Pandrex247 Pandrex247 deleted the Mail-Platform-TCK branch March 21, 2025 09:24
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.

3 participants