Skip to content
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

Better shutdown sequence (taken from official example) & some renamings #104

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 3 additions & 4 deletions build/conformance/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ RUN <<EOF
CONFORMANCE_URL="https://github.com/connectrpc/conformance/releases/download/${CONFORMANCE_VERSION}/connectconformance-${CONFORMANCE_VERSION}-${UNAME_OS}-${UNAME_ARCH}.tar.gz"
echo "Downloading conformance from ${CONFORMANCE_URL}"
curl -sSL "${CONFORMANCE_URL}" -o conformance.tgz
tar -xvzf conformance.tgz
chmod +x connectconformance
tar -xvzf conformance.tgz && chmod +x connectconformance
EOF

FROM sbt_image AS build
Expand All @@ -40,7 +39,7 @@ RUN mkdir "/logs"
RUN echo ">>>>> Running stable tests <<<<<"
RUN LOGS_PATH="/logs" \
./connectconformance \
--conf suite-stable.yaml \
--conf suite.yaml \
--mode server \
--parallel 1 \
-v -vv --trace \
Expand All @@ -51,7 +50,7 @@ RUN LOGS_PATH="/logs" \
RUN echo ">>>>> Running unstable tests <<<<<"
RUN LOGS_PATH="/logs" \
./connectconformance \
--conf suite.yaml \
--conf suite-unstable.yaml \
--mode server \
--parallel 1 \
-v -vv --trace \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# https://github.com/connectrpc/conformance/blob/main/docs/configuring_and_running_tests.md#configuration-files
features:
versions: [ HTTP_VERSION_1, HTTP_VERSION_2 ]
versions: [ HTTP_VERSION_1 ]
protocols: [ PROTOCOL_CONNECT ]
codecs: [ CODEC_JSON ]
codecs: [ CODEC_PROTO ]
stream_types: [ STREAM_TYPE_UNARY ]
supports_tls: false
supports_trailers: false
Expand Down
4 changes: 2 additions & 2 deletions build/conformance/suite.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# https://github.com/connectrpc/conformance/blob/main/docs/configuring_and_running_tests.md#configuration-files
features:
versions: [ HTTP_VERSION_1 ]
versions: [ HTTP_VERSION_1, HTTP_VERSION_2 ]
protocols: [ PROTOCOL_CONNECT ]
codecs: [ CODEC_PROTO ]
codecs: [ CODEC_JSON ]
stream_types: [ STREAM_TYPE_UNARY ]
supports_tls: false
supports_trailers: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ object ClientCalls {
call.start(CallbackListener[Resp](cb), headers)
call.sendMessage(request)
call.halfClose()
// request 2 messages to catch a case when a server sends more than one message
call.request(2)

Some(Async[F].delay(call.cancel("Cancelled", null)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ object InProcessChannelBridge {
s"GRPC server did not shut down in $waitForShutdown, consider increasing shutdown timeout"
)
}

val res2 = s.shutdownNow().awaitTermination(waitForShutdown.toMillis, TimeUnit.MILLISECONDS)
if (!res2) {
logger.warn(
s"GRPC server did not shut down in $waitForShutdown, consider increasing shutdown timeout"
)
}
}

Resource.make(acquire)(release)
Expand Down
Loading