eugenegujing opened a new pull request, #6492:
URL: https://github.com/apache/texera/pull/6492

   ### What changes were proposed in this PR?
   
   Adds `test_async_rpc_server.py` (new, 26 tests) for the Python worker's 
`AsyncRPCServer` 
(`amber/src/main/python/core/architecture/rpc/async_rpc_server.py`).
   
   What the tests cover:
   - **Handler map**: method names are stored lowercased and looked up 
correctly.
   - **Stream wrapper**: the fake stream keeps returning the same request on 
every read, and keeps only the last message the handler sends.
   - **Normal calls**: a reply goes back with the right command id and return 
value, the handler gets the unwrapped request, lookup ignores case, and a 
missing request reaches the handler as `None`.
   - **Errors**: a handler that raises, and a call to an unknown method, both 
come back as a `ControlError` marked `ErrorLanguage.PYTHON` (including when the 
error has no message).
   - **Fire-and-forget**: a negative command id sends no reply (on success, 
error, and unknown-method paths), while command id 0 still replies.
   - **Reply routing**: the reply goes to the context's sender/receiver when 
both are set, otherwise it falls back to swapping the sender and receiver of 
the incoming channel; either way the reply channel is a control channel.
   
   ### Any related issues, documentation, discussions?
   
   Closes #6485
   
   ### How was this PR tested?
   
   ```
   cd amber/src/main/python
   python -m pytest ../../test/python/core/architecture/rpc/ -v
   # 41 passed (26 new AsyncRPCServer tests + 15 existing AsyncRPCClient tests)
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Co-authored by: Claude Code (Fable 5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to