-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Exceptions being swallowed if reported in a Hook #133
Comments
Yeah there are still a few bugs in the pretty formatter. It's not well tested, and could do with some more edge-casy unit tests. -And there is some experimental logic in there for printing the same line several times (before and after execution) that relies on special TTY ANSI characters (for up). This isn't going anywhere and can be removed. Removing this first would make it easier to fix other bugs like this one. |
I'm not sure how to reproduce this bug so it can be fixed. Please submit more detail. |
Okay, I'll try to build a sample project that demonstrates this after I get done building a sample project for work that has problems with hazelcast :( |
Okay, I've got a repo that reproduces the issue: https://github.com/dkowis/Cucumber-JVM-Ruby-Example/tree/error_swallow Hopefully that will be enough to describe it. I think if we were to redo the pretty formatter along the lines of previous discussion [1] the issue would be solved, as the issue is that it tries to pop something off the stack that was never added (there's no line for after hooks). 1: I think we were talking about rewriting it so it'd make two passes through the feature file so it knew where to align things, as well as not doing the fancy shell codes to jump up a line. I don't remember all the details though. |
We had a similar problem when using custom SpringObjectFactory. When we had exceptions during the startup of our spring-context the exception had been swallowed which resulted in a NPE in the PrettyFormatter. |
@klausbayrhammer yeah I just had the same problem, no custom SpringObjectFactory, but somehow we have duplicate spring beans, probably due to something that changed in how cucumber-jvm loads stuff :) But the problem is still that the exception is swallowed. @aslakhellesoy do you have enough data using my sample project as well as the other examples listed here? I could probably work on this as well, but I haven't been in the code in a while, and real life is really really busy right now :( |
I'm very busy myself at the moment, so some help on this would be great. The codebase hasn't changed that much since you were in it I think. In any case - this looks like a bug in gherkin's PrettyFromatter. |
Yeah, I'm looking at seeing what I can do to fix it without rewriting the entire pretty formatter. |
Filed this issue, because some changes are also necessary to the JSON formatter as well, sadly. |
I see that this is fixed in my sample branch. Looks good to me. Thanks for all the hard work! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
So in that stack trace there's a bit of code that I added to the RuntimeWorld at line 69 to print the stack trace of the Throwable before it's handed off to the result, because that's the last place in the main stack trace about the Index Out of Bounds Exception.
The cause is a undefined method "failed?" in the After Hook being executed (in Jruby, because somehow the ScenarioResult object isn't being set, but that's a different issue.) So when the reporter gets ahold of this, and tries to output the error, it cannot, because there are no more steps for it to report on, and so it runs over the Array.
This was while running the Jruby CLI feature executor.
The text was updated successfully, but these errors were encountered: