-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve ExpectNextNAsync error message clarity #7616
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
Conversation
Previous error messages were unclear when ExpectNextNAsync failed, especially in tests (e.g., with Kafka). The new message includes the exact index of the mismatch and shows both expected and actual values. Old: "Expected one of (1, 2, 3, ...), but got '5'" New: "Expected element at index 24 to be '25', but got '5'" This improves debugging clarity for stream-based tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@CodingPythonMan congrats on your first contribution to Akka.NET 🥳 |
Thank you so much, @Aaronontheweb 🙏 |
Previous error messages were unclear when ExpectNextNAsync failed, especially in tests (e.g., with Kafka). The new message includes the exact index of the mismatch and shows both expected and actual values.
Old:
"Expected one of (1, 2, 3, ...), but got '5'"
New:
"Expected element at index 24 to be '25', but got '5'"
This improves debugging clarity for stream-based tests and addresses developer confusion in cases with large input sequences.
Fixes #7536
Changes
Updated
ExpectNextNTask
to provide clearer error messages with exact mismatch index and values.Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):
ExpectNextNAsync
unfriendly error message #7536