-
Notifications
You must be signed in to change notification settings - Fork 148
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
CDI Test failures with GlassFish 7 #23961
Comments
https://docs.google.com/spreadsheets/d/18BARERS-smPDv6vfK-73k5Gy3OrA2mUvBamwL7iGA3Q/edit#gid=1305635927
|
This was Weld failure indeed, 5.0.0.SP2 is syncing with Central now and it should fix the issue.
This isn't Weld related, it's the TCKs asserting bean types of |
CDI TCK 4.0.4 is promoted: |
6 remaining failures :)
|
I have another bug in Weld, probably - I am able to hack and workaround it in GlassFish, but it would be quite nasty. It relates to InjectionPointTest, but maybe affects others too, I did not try it yet. Here Nasty hack I tried and test passed - I'm unwrapping the cause until I find the DefinitionException in causes, then just rethrowing it. EDIT: Absolutely the same applies to AmbiguousInjectionIntoNonContextualComponentTest and DeploymentException. |
You will have to install an https://github.com/jakartaredhat/wf-core-tck-runner/blob/main/cdi-tck/src/main/java/org/jboss/wildfly/tck/cdi/WildFlyExceptionTransformer.java |
There already is such extension, I can change it, but ... that is rather hacking the test, because then if the specification expects DeploymentException and DefinitionException, in fact it is not thrown neither from GlassFish server nor from Weld, it is just a cause deep inside the stacktrace. The real-world user then cannot expect that. Is it really the correct solution for this? |
Quickly looking at the code, the IAE is (probably) thrown because the method, and it's validation, are used from several different places in which definition exception isn't required or doesn't make much sense.
Yea, same thing is in Weld repo for TCK execution.
This is an error case. The hypothetical real-world user won't intend to write a bean that blows up their application. Instead, they just need to get a sensible message for why it failed. Whether that's straight up definition exception or wrapped in IAE doesn't matter that much IMO. |
It is an error case tested by CDI TCK we try to hack. The message is alright, but that is not tested by the CDI TCK. |
I found yet another "unwrapping" solution already present in GlassFish. So you can take this discussion just as something to consider, but there is no acute action required from Weld team. |
The In cdi-tck 3.0,
In cdi-tck 4.0.4,
EDIT: In "annotated" bean discovery mode, BravoLocator is not regarded as bean. This causes that a different bean manager is returned by |
A possible cause is that the root BDA (RootBeanDeploymentArchive) has a reference to beans.xml in WAR. assertEquals(MarkerObtainerNonBda.getBeans(Marker.class).size(), 0); Removing the reference to beans.xml from the root BDA (that is, reverting #23944) will resolve the failure of |
In failed tests Either of the following options may resolve failures of these two tests:
Option 1 fixes TCK to generate beans.xml that is semantically equivalent to CDI 3.0 TCK. Option 2 fixes GlassFish to override the BeanDeploymentArchive.getKnownClasses method, which is called from ClassNameToBeanManager.findBeanManager. |
That might be a root cause for some of the other failures we saw, and which needed somewhat elaborate workarounds to pass. See e.g. this one: #23965 The tests gets a bean manager from the root archive, and we needed to do elaborate wrapping to point it back to the right archive. |
@tnagao7 those are good finds! |
All the CDI TCK tests are passing! :)
|
Running the CDI TCK (using the runner in GlassFish) there are 11 failures as of today:
[ERROR] Failures:
org.omg.CORBA.BAD_OPERATION: The delegate has not been set! vmcid: 0x0 minor code: 0 completed: No
Fixed by Weld update:
See jakartaee/cdi#624 (comment)
Fixed by CDI TCK update:
See jakartaee/cdi-tck#380
Tests can be run from
[glassfish]/appserver/tests/tck/cdi
using:mvn clean install
Individual tests can be run via
mvn clean install -Dit.test=ExcludeFiltersTest#testExcludeSystemPropertyActivator
Tests can be debugged via:
mvn clean install -Dit.test=ExcludeFiltersTest#testExcludeSystemPropertyActivator -Dglassfish.suspend
The text was updated successfully, but these errors were encountered: