-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Inline grpc in functional tests [WiP] #9133
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
base: main
Are you sure you want to change the base?
Conversation
|
See this old draft pr: #6733. I wanted to try using it in production too, eventually. |
b6d037c to
faf8c6e
Compare
|
@dnr I remember this! I wonder if we can re-use Conceptually I see (1) test-to-service and (2) service-to-service and (3) service-to-sdkworker communication. During testing it'd be great to optimize at least (1) and even better also (2) with this. |
40e6952 to
202733e
Compare
318cc62 to
acaf6a3
Compare
81d58eb to
921d00c
Compare
6c772a0 to
132177a
Compare
| Attributes: &commandpb.Command_CompleteWorkflowExecutionCommandAttributes{ | ||
| CompleteWorkflowExecutionCommandAttributes: &commandpb.CompleteWorkflowExecutionCommandAttributes{}, | ||
| }, |
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.
[31mFailed�[0m
2026-01-26T20:36:04.8205423Z === �[31mFAIL�[0m: tests TestQueryWorkflowSuite/TestQueryWorkflow_FailurePropagated (4.13s)
2026-01-26T20:36:04.8206050Z functional_test_base.go:373: Running TestQueryWorkflowSuite/TestQueryWorkflow_FailurePropagated in test shard 1/3
2026-01-26T20:36:04.8206195Z query_workflow_test.go:395:
2026-01-26T20:36:04.8206629Z Error Trace: /home/runner/work/temporal/temporal/tests/query_workflow_test.go:395
2026-01-26T20:36:04.8206842Z Error: Received unexpected error:
2026-01-26T20:36:04.8208035Z BadCompleteWorkflowExecutionAttributes: CompleteWorkflowExecutionCommandAttributes is not set on CompleteWorkflowExecutionCommand.
2026-01-26T20:36:04.8208395Z Test: TestQueryWorkflowSuite/TestQueryWorkflow_FailurePropagated
Apparently the protobuf deserialization implicitly initializes this? Since that's gone now doing it explicitly here now.
0c42462 to
f553f41
Compare
Port the inline RPC implementation from PR temporalio#6733 "Inline matching/history rpcs and local load balancing". This provides an in-process gRPC client that routes calls directly to handlers without network overhead. Key changes: - Add common/rpc/inline package with ClientConn implementing grpc.ClientConnInterface - Change RPCFactory interface to return grpc.ClientConnInterface instead of *grpc.ClientConn - Update client/history to use interface type with type assertion for ResetConnectBackoff Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
9f7b6bf to
76788fe
Compare
76788fe to
826300d
Compare
What changed?
Replaces the real grpc networking implementation in functional tests with an in-process/inline implementation.
Inspired by #6733
Why?
The goal is to reduce CPU usage and memory allocation (which in turn reduces GC pressure) in order to reduce CI test times.
Local benchmark
NOTE:
UpdateWorkflowSdkSuitelikely shows less improvement due to the SDK Worker which is still using the real network.No test execution time improvement was recorded locally (I suspect tests are largely IO bound ...).
CI comparison
Comparison with random CI run from main.
Most jobs showed a minor reduction of a few minutes in execution time.
NOTE: CI runners (being cloud-based) are known to show inconsistent performance.
How did you test it?
Potential risks
There's a risk that the inline gRPC skips/hides behavior we'd see in a real network. I believe this is a minimal risk; and should be mitigated by our nightly stress testing pipeline that runs on a real (cloud) network.