-
Notifications
You must be signed in to change notification settings - Fork 29
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 support for tests with intentional app deployment failures #137
Comments
There are already many TCK tests which intentionally cause deployment failures in the CDI TCK which have no issues, so we need to see what's different with these tests. |
Assuming we're talking about this test: https://github.com/jakartaee/platform-tck/blob/c4d7da5b46aae3acaf8f9f2eed1ac2b07bb25468/websocket/spec-tests/src/main/java/com/sun/ts/tests/websocket/negdep/malformedpath/WSCClientIT.java#L46-L47 Comparing to LookupAmbiguousTest from the CDI TCK, the CDI test has The platform TCK test does not have this annotation so I'm not sure how the arquillian container is supposed to know that that deployment is not expected to succeed. |
That test among others, yeah. Thanks for sharing the mechanism for this. I can update all of the failing tests locally and see if that gets OL a cleaner looking result. If so, this becomes an obvious TCK challenge. Curious how Tomcat might be passing this TCK in its current state, unless they either a) aren't failing the deployments or b) are compensating for it in their own Arquillian plugin. |
Note that The arqillian support feature looks for and reports the exceptions thrown during app startup so that we can check the correct exception was thrown so you should have it installed and enabled if you're running tests expecting deployments to fail. (The arquillian container will fall back to searching FFDC logs if the support feature is not installed, but you don't always get FFDCs out if several tests cause similiar exceptions to be thrown). |
Noted. There is likewise a |
Hey @Azquelt, Brian tried the Line 1484 in 3aec059
It looks for the CWWKZ0002 error message and then throws a DeploymentException to Arquillian. However, in our websocket scenario, we don't log CWWKZ0002. We only log:
This looks like it might cause issues with how |
@volosied Why is Does |
The app does not start, and these are the only messages from the console.log. I don't know why
|
I look a look at one CDI application (LegacyNonEmpty that reports the CDI has an implementation for applicationStarting: WebContainer does not: However, I don't know all the various paths the UPDATE: I was looking at the webcontainer initialization process and found this code: If I set
It's not the original websocket deployment error, but it looks like this is where we need to look further. It seems like we need to throw a StateChangeException to get the However, I'm worried about updating any code here. It could cause a regression. I'm also not familiar with the deployment code either. The default code is executed from the Runnable (run doesn't throw any exceptions), so I don't think we can just simply throw an exception here. Likely why it was coded this way. |
Possibly? I'm not sure. For CDI it looks like we do throw a Arquillian will check the exception thrown and all of its causes for the expected exception when a deployment fails.
I don't think we should be changing any liberty code here, but we need to understand how the startup failure is being reported. At the moment, the It then has various ways of getting the exception that caused the failure (see the classes in the exceptions package), but if you have the arquillian-support-feature, it will call that which uses IncidentListener which listens for a It sounds like in your case, both of those things aren't true? It looks like the message that reports that the app fails to start is
so we probably need to look for that as well as I'm not familiar with the deployment code either, so I'm not sure when you would get We then also need a way of getting hold of the actual exception that occurred (ideally we would enable arquillian support feature to report the exact exception thrown, though we could also make up an exception based on the logs as the fallback logic in CDILogExceptionLocator does). I would suggest you discuss with the liberty kernel team on what they think is the best way to do this. |
@Azquelt I was able to get the following message logged ( with the help of
From here, arquillian should be able to pick up the original exception -- |
Yes, if you get that message and an FFDC for Ideally though, the liberty-arquillian container would pick up the exception however it's thrown. |
I thought we did work to make |
Hey @jhanders34 @brideck was able to make some progress with this issue through However, some more issues were discovered in the websocket TCK. It's likely going to be challenge, and we'll see where the conversation goes from there. |
@volosied has opened a challenge against the WebSocket TCK -- jakartaee/websocket#465 We'll see if that makes any headway for us. |
Mark isn't against improving the websocket tests, but he thinks it's a liberty / arquillian integration problem. The Tomcat and Glassfish Arquillian plugins have a simpler deploy method, so Brian will see what he can do with our code. Any changes will be hidden behind a property, of course. |
I'm not sure why he thinks it's a liberty / arquillian integration problem. As far as I can see, the test expects an application to start. If it's valid for the application to not start in response to the exception that the spec requires, then the test is wrong. The issue that you originally raised where an app can fail to start without logging |
Found that we actually have a special case for these very tests in the legacy porting package for the Platform TCK. That code prevents the deployer from throwing a deployment exception when the app fails to start, and allows it to proceed. For better or worse, I've added a PR here that will essentially provide the equivalent behavior option to this plugin, as it matches our precedent. I suspect that trying to force a TCK change would require everyone else to update their plugins in order to handle the deployment exception case properly. |
Good detective work, at least this means we know it's not a new problem.
I suspect it wouldn't, since they would need to implement it at least somewhat correctly to pass the CDI TCK. Practically I can understand not fixing it until the next release. |
This is likely true for full EE implementations like Glassfish that have had to concern themselves with the CDI TCK. Potentially less likely true for other implementers of WebSocket, like Tomcat, since these tests are used for them, too. |
I've continued pushing on the TCK side as well. They handed me a Glassfish + Tyrus runner, and interestingly they don't seem to fail app deployment for these at all. Maybe we can get them to throw these tests out for EE 11/WS 2.2 and address in future. |
Certainly it's difficult to test if the spec isn't clear on whether the app should deploy successfully or not. The plot thickens :) |
Some TCKs contain tests that are intentionally causing and testing deployment failures. These have no hope of passing currently because any deployed app that fails to start causes an exception to be thrown from the plugin:
I'm not sure if there's a better way to check for this particular scenario, but we could add a configuration property (e.g.
allowAppDeployFailures
) that makes it so the expected/desired state of deployed applications to just be INSTALLED instead of STARTED.The text was updated successfully, but these errors were encountered: