From c9d5584444d996dd2d6f7a73e75fed4829b0bbf5 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Thu, 29 Aug 2024 17:55:43 +0200 Subject: [PATCH 1/3] Increase grace period for deadline propagation Signed-off-by: Timo Stamm --- internal/app/connectconformance/results.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/internal/app/connectconformance/results.go b/internal/app/connectconformance/results.go index fa595ab6..fcca3c60 100644 --- a/internal/app/connectconformance/results.go +++ b/internal/app/connectconformance/results.go @@ -35,10 +35,17 @@ import ( "google.golang.org/protobuf/types/known/anypb" ) -// CI environments have been observed to have 150ms of delay between the deadline -// being set and it being serialized in a request header. This adds a little extra -// headroom to avoid flaky tests. -const timeoutCheckGracePeriodMillis = 250 +// In tests for deadline propagation, the client sends a request with a timeout +// and has the server report the timeout in the response. The test runner then +// compares the reported timeout against the requested timeout. +// However, servers typically start counting down from the original timeout as +// soon as request headers arrive, and provide only the _remaining_ time via +// their API. It is therefore to be expected that the server reports a smaller +// value than the requested timeout, depending on the time spent processing the +// request body and preparing the response. +// CI environments have been observed to have up to 350ms of delay. This adds a +// little extra headroom to avoid flaky tests. +const timeoutCheckGracePeriodMillis = 500 // testResults represents the results of running conformance tests. It accumulates // the state of passed and failed test cases and also reports failures to a given From bed3232887edab36b2b2175977eb203632f12380 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Tue, 10 Sep 2024 16:04:48 +0200 Subject: [PATCH 2/3] Add tests for omitted message in Connect error Signed-off-by: Timo Stamm --- .../data/connect_client_error_endstream.yaml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml b/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml index c7a85c22..68557e67 100644 --- a/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml +++ b/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml @@ -83,6 +83,25 @@ testCases: error: code: CODE_UNAVAILABLE message: oops + - request: + testName: error/message-omitted + service: connectrpc.conformance.v1.ConformanceService + method: Unary + streamType: STREAM_TYPE_UNARY + requestMessages: + - "@type": type.googleapis.com/connectrpc.conformance.v1.UnaryRequest + responseDefinition: + rawResponse: + statusCode: 401 + headers: + - name: content-type + value: [ "application/json" ] + unary: + text: | + { "code": "unauthenticated" } + expectedResponse: + error: + code: CODE_UNAUTHENTICATED - request: testName: error/allow-unrecognized-fields service: connectrpc.conformance.v1.ConformanceService @@ -273,6 +292,30 @@ testCases: error: code: CODE_UNKNOWN message: oops + - request: + testName: end-stream/message-omitted + service: connectrpc.conformance.v1.ConformanceService + method: ServerStream + streamType: STREAM_TYPE_SERVER_STREAM + requestMessages: + - "@type": type.googleapis.com/connectrpc.conformance.v1.ServerStreamRequest + responseDefinition: + rawResponse: + statusCode: 200 + headers: + - name: content-type + value: [ "application/connect+proto" ] + stream: + items: + - flags: 2 + payload: + text: | + { + "error": { "code": "unauthenticated" } + } + expectedResponse: + error: + code: CODE_UNAUTHENTICATED - request: testName: end-stream/allow-unrecognized-fields service: connectrpc.conformance.v1.ConformanceService From e06b7daf9875d36433b2e500134548a71cfcb9f8 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Wed, 11 Sep 2024 12:34:37 +0200 Subject: [PATCH 3/3] Rename tests Signed-off-by: Timo Stamm --- .../testsuites/data/connect_client_error_endstream.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml b/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml index 68557e67..ceca94bb 100644 --- a/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml +++ b/internal/app/connectconformance/testsuites/data/connect_client_error_endstream.yaml @@ -84,7 +84,8 @@ testCases: code: CODE_UNAVAILABLE message: oops - request: - testName: error/message-omitted + # The message property is optional - it can be omitted or be an empty string + testName: error/missing-message service: connectrpc.conformance.v1.ConformanceService method: Unary streamType: STREAM_TYPE_UNARY @@ -293,7 +294,8 @@ testCases: code: CODE_UNKNOWN message: oops - request: - testName: end-stream/message-omitted + # The message property is optional - it can be omitted or be an empty string + testName: end-stream/missing-message service: connectrpc.conformance.v1.ConformanceService method: ServerStream streamType: STREAM_TYPE_SERVER_STREAM