-
Notifications
You must be signed in to change notification settings - Fork 641
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
Fix calls to Exception.StackTrace #932
Comments
I reviewed this yesterday, and in addition to the translation errors in the original issue, there is highly inconsistent translation of As @NightOwl888 noted:
In Java, To solve this, I'm moving the TestFramework's Additionally, I'm moving the StackTraceHelper type into Support as noted in the original ticket, with a new method |
One thing of note is that randomizedtesting injects the random seed and other debugging details into the stack trace. I haven't looked into what the most reasonable way to do that would be. But, it might be useful to have a way to accomplish that sort of thing by the test framework since we are not planning on porting randomizedtesting for the release. I think that it would be more useful if we had that injected into the live debugging info rather than just the output from |
Oh, one more thing, sort of related. There is an In hindsight, I wonder if it would make more sense to use Although, we never worked out why the |
This seems like something that could be broken out into its own issue. |
Yeah, probably. But it is related to printing out the stack trace, so I thought I would mention it here. Even if it means doing it separately and retrofitting the stack trace printing, as required. Currently, the |
Ah I see what you mean, makes sense. I'll see if it is coherent to include that in this PR or break it out separately. |
* SWEEP: Exception.StackTrace cleanup, #932 * Add unit tests for StackTraceHelper, #932 * Better assert for PrintCurrentStackTrace that caller is the top line * PR feedback * Add string.Contains extension method for .NET Framework and Standard 2.0 * Use MemoryExtensions.Contains * Revert test code to use extension method * Use is null
new Exception().StackTrace
is an incorrect translation from Java. We should find all calls toException.StackTrace
as well as theStackTrace
class and convert them correctly. From ChatGPT:We have a class called
StackTraceHelper
that we could add the support to convert it to a string. There are also several calls to.printStackTace()
that should be reviewed. In .NET,Exception.StackTrace
doesn't contain the exception type, so a lot of the tests useException.ToString()
instead. But we would be better off with a centralized way of dealing with stack traces (in Support) -StackTraceHelper
only applies to the test code, but there is code in production that is also not correctly translated. Of course, since it is something we own, moving it to Support is an option.In short, we want to review all of the code that was using
.getStackTrace()
or.printStackTrace()
in Lucene.Originally posted by @NightOwl888 in #926 (comment)
The text was updated successfully, but these errors were encountered: