Skip to content

Commit

Permalink
Implement stream operations in the conformance client (#196)
Browse files Browse the repository at this point in the history
This doesn't (yet) run the conformance tests for stream operations
in CI because there are some flaky failures that need a little more
troubleshooting to stabilize.
  • Loading branch information
jhump committed Jan 16, 2024
1 parent 8ecb275 commit 30c7c69
Show file tree
Hide file tree
Showing 28 changed files with 392 additions and 108 deletions.
23 changes: 16 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,39 @@ runconformance: runcrosstests runconformancenew
runconformancenew: generate $(CONNECT_CONFORMANCE) ## Run the new conformance test suite.
./gradlew $(GRADLE_ARGS) conformance:client:google-java:installDist conformance:client:google-javalite:installDist
$(CONNECT_CONFORMANCE) -v --mode client --conf conformance/client/lite-unary-config.yaml \
--known-failing conformance/client/known-failing-cases.txt -- \
--known-failing conformance/client/known-failing-unary-cases.txt -- \
conformance/client/google-javalite/build/install/google-javalite/bin/google-javalite \
--style suspend
$(CONNECT_CONFORMANCE) -v --mode client --conf conformance/client/lite-unary-config.yaml \
--known-failing conformance/client/known-failing-cases.txt -- \
--known-failing conformance/client/known-failing-unary-cases.txt -- \
conformance/client/google-javalite/build/install/google-javalite/bin/google-javalite \
--style callback
$(CONNECT_CONFORMANCE) -v --mode client --conf conformance/client/lite-unary-config.yaml \
--known-failing conformance/client/known-failing-cases.txt -- \
--known-failing conformance/client/known-failing-unary-cases.txt -- \
conformance/client/google-javalite/build/install/google-javalite/bin/google-javalite \
--style blocking
$(CONNECT_CONFORMANCE) -v --mode client --conf conformance/client/standard-unary-config.yaml \
--known-failing conformance/client/known-failing-cases.txt -- \
--known-failing conformance/client/known-failing-unary-cases.txt -- \
conformance/client/google-java/build/install/google-java/bin/google-java \
--style suspend
$(CONNECT_CONFORMANCE) -v --mode client --conf conformance/client/standard-unary-config.yaml \
--known-failing conformance/client/known-failing-cases.txt -- \
--known-failing conformance/client/known-failing-unary-cases.txt -- \
conformance/client/google-java/build/install/google-java/bin/google-java \
--style callback
$(CONNECT_CONFORMANCE) -v --mode client --conf conformance/client/standard-unary-config.yaml \
--known-failing conformance/client/known-failing-cases.txt -- \
--known-failing conformance/client/known-failing-unary-cases.txt -- \
conformance/client/google-java/build/install/google-java/bin/google-java \
--style blocking
# TODO: streaming conformance test cases

# TODO: Add streaming conformance tests. Currently, a small number of the test cases
# are flaky, so leaving this commented out for now.
# (Will continue investigating and address soon).
# $(CONNECT_CONFORMANCE) -v --mode client --conf conformance/client/lite-stream-config.yaml \
# --known-failing conformance/client/known-failing-stream-cases.txt -- \
# conformance/client/google-javalite/build/install/google-javalite/bin/google-javalite
# $(CONNECT_CONFORMANCE) -v --mode client --conf conformance/client/standard-stream-config.yaml \
# --known-failing conformance/client/known-failing-stream-cases.txt -- \
# conformance/client/google-java/build/install/google-java/bin/google-java

.PHONY: runcrosstests
runcrosstests: generate ## Run the old cross-test suite.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ class JavaHelpers {
get() = msg.serverTlsCert
override val clientTlsCreds: TlsCreds?
get() = if (msg.hasClientTlsCreds()) TlsCredsImpl(msg.clientTlsCreds) else null
override val receiveLimitBytes: Int
get() = msg.messageReceiveLimit
override val timeoutMs: Int
get() = msg.timeoutMs
override val requestDelayMs: Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ class JavaLiteHelpers {
get() = msg.serverTlsCert
override val clientTlsCreds: TlsCreds?
get() = if (msg.hasClientTlsCreds()) TlsCredsImpl(msg.clientTlsCreds) else null
override val receiveLimitBytes: Int
get() = msg.messageReceiveLimit
override val timeoutMs: Int
get() = msg.timeoutMs
override val requestDelayMs: Int
Expand Down
15 changes: 15 additions & 0 deletions conformance/client/known-failing-stream-cases.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# OkHttp seems to have a bug where timeout is not properly
# enforced when request body is full-duplex.
Timeouts/HTTPVersion:2/**/bidi half duplex timeout
Timeouts/HTTPVersion:2/**/bidi full duplex timeout

# Connect-kotlin does not have a way to limit the size of messages
# received. It probably should. Despite this, many cases in this suite
# still pass, so they are likely not exercising what we think they are.
# TODO: add flag to config yaml for whether implementation supports
# a receive size limit
Client Message Size/**/Compression:COMPRESSION_GZIP/TLS:false/**/client stream first request exceeds client limit
Client Message Size/**/Compression:COMPRESSION_GZIP/TLS:false/**/client stream subsequent request exceeds client limit
Client Message Size/**/Compression:COMPRESSION_GZIP/TLS:false/**/client stream all requests equal to client limit
Client Message Size/**/Compression:COMPRESSION_GZIP/TLS:false/**/server stream request equal to client limit
Client Message Size/**/Compression:COMPRESSION_GZIP/TLS:false/**/server stream request exceeds client limit
File renamed without changes.
25 changes: 25 additions & 0 deletions conformance/client/lite-stream-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This configures the features that this client
# supports and that will be verified by the
# conformance test suite.
features:
versions:
- HTTP_VERSION_1
- HTTP_VERSION_2
protocols:
- PROTOCOL_CONNECT
- PROTOCOL_GRPC
- PROTOCOL_GRPC_WEB
codecs:
- CODEC_PROTO
# Lite does not support JSON
compressions:
- COMPRESSION_IDENTITY
- COMPRESSION_GZIP
streamTypes:
# This config file only runs stream RPC test cases.
- STREAM_TYPE_CLIENT_STREAM
- STREAM_TYPE_SERVER_STREAM
- STREAM_TYPE_HALF_DUPLEX_BIDI_STREAM
- STREAM_TYPE_FULL_DUPLEX_BIDI_STREAM
# TODO: get client certs working and uncomment this
#supportsTlsClientCerts: true
4 changes: 2 additions & 2 deletions conformance/client/lite-unary-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ features:
# so that we can run them all three ways: suspend,
# callback, and blocking.
- STREAM_TYPE_UNARY
supportsTlsClientCerts: true
supportsHalfDuplexBidiOverHttp1: true
# TODO: get client certs working and uncomment this
#supportsTlsClientCerts: true
Loading

0 comments on commit 30c7c69

Please sign in to comment.