Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dimos/protocol/rpc/test_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,20 @@ def test_exception_handling_sync(rpc_context, impl_name: str) -> None:

try:
# Test successful call
result, _ = client.call_sync("test_exc", (["ok"], {}), rpc_timeout=2.0)
result, _ = client.call_sync("test_exc", (["ok"], {}), rpc_timeout=5.0)
assert result == "Success: ok"

# Test builtin exception - should raise actual ValueError
with pytest.raises(ValueError) as exc_info:
client.call_sync("test_exc", (["fail"], {}), rpc_timeout=2.0)
client.call_sync("test_exc", (["fail"], {}), rpc_timeout=5.0)
assert "Test error message" in str(exc_info.value)
# Check that the cause contains the remote traceback
assert isinstance(exc_info.value.__cause__, RemoteError)
assert "failing_function" in exc_info.value.__cause__.remote_traceback

# Test custom exception - should raise RemoteError
with pytest.raises(RemoteError) as exc_info:
client.call_sync("test_exc", (["custom"], {}), rpc_timeout=2.0)
client.call_sync("test_exc", (["custom"], {}), rpc_timeout=5.0)
assert "Custom error" in str(exc_info.value)
assert "CustomTestError" in exc_info.value.remote_type
assert "failing_function" in exc_info.value.remote_traceback
Expand Down