-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
AssertionFailedError loses stacktrace in process isolation when chaining with a previous exception #5068
Comments
Will file a PR soon. |
Running tests, I realized this occurs only when the test is executed in a separate process. Which is the case of Drupal functional tests where we found this issue. When executed within the same process, the stack trace is printed. Thanks @alexpott for pointing this out. |
I will leave this ticket open for now, but please note that I will not work on this as I do not think that this edge case is worth pursuing. I strongly recommend to change your implementation of |
Let's not waste time, then. |
Summary
Identified in #4983.
When a
AssertionFailedError
is thrown as a re-throw of a previous exception (for instance as part of aonNotSuccessfulTest()
callback), and the previous exception is chained in, the failure reported by PHPUnit traces to the part where AssertionFailedError was thrown, and the original trace is lost. So there is no information about where the test failed.Current behavior
How to reproduce
Implement a
onNotSuccessfulTest()
callback in a test, and add logic so that a Throwable is re-thrown as aAssertionFailedError
with the Throwable chained in. For example,Expected behavior
The text was updated successfully, but these errors were encountered: