-
Notifications
You must be signed in to change notification settings - Fork 71
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 exception-swallowing code path #623
Conversation
d3625c1
to
b0b8bf3
Compare
👍 I saw this one the other day, but I don't remember the context or why I didn't create the issue (or can't find it) |
b0b8bf3
to
7f32149
Compare
7f32149
to
70b466d
Compare
Added a test based on monkey-patching the
Ready for review. |
Shouldn't need to monkey patch, should be easy enough to make whichever code path occur against a real server |
Actually, monkey patching is more appropriate in this case. What we're trying to assert is that if the client receives an |
I personally prefer the end to end integration test, and not too concerned about speed (we have an already-exists integration test already I think). We have dozens of tests using the server harmlessly to test actual client behavior in actual situations without advanced knowledge of inner workings. Patching is brittle IMO, but if you feel you must do it, ok. |
EDIT: Nevermind, I misread the original code and thought we were swallowing more than just already-exist-wrong-details exceptions. Can ignore my desire for integration tests here. |
You're right though! The test is a bit brittle. But yes here we're in a situation where there's a code path that's technically a bug, but not obvious how to repro it with a real interaction with a server, and yet we have an obligation to put in a test to back the fix. |
271eefb
to
a47bc69
Compare
Fixes #624
This is a bug identified by pyright type checking.
How this was tested
main
before the fix, and the fix.I also confirmed manually that if the server responds with gRPC error
ALREADY_EXISTS
, but the error details do not satisfy the logic in the SDK code, then the user getsWhat they should get is
temporalio.service.RPCError
.