From 1ed0b8e3d72abcc4788e89cab4caa4e8c0083985 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 14 Sep 2016 15:01:16 -0700 Subject: [PATCH 01/12] Add interop test for Cacheable Unary Calls modified interop test spec doc added CacheableUnaryCall to test.proto modified server and client implmenentations to support new method --- doc/interop-test-descriptions.md | 21 +++++++++++++++ src/proto/grpc/testing/test.proto | 5 ++++ test/cpp/interop/client.cc | 4 +++ test/cpp/interop/interop_client.cc | 43 ++++++++++++++++++++++++++++++ test/cpp/interop/interop_client.h | 1 + test/cpp/interop/interop_server.cc | 11 ++++++++ 6 files changed, 85 insertions(+) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 1e04966380c..5b3ad2335cc 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -60,6 +60,27 @@ Client asserts: *It may be possible to use UnaryCall instead of EmptyCall, but it is harder to ensure that the proto serialized to zero bytes.* +### cacheable_unary + +This test verifies that gRPC requests marked as cacheable use GET verb instead +of POST, and that server sets appropriate cache control headers for the response +to be cached by a proxy. This interop test requires that the server is behind +a caching proxy. It is NOT expected to pass if client is accessing the server +directly. + +Server features: +* [CacheableUnaryCall][] + +Procedure: + 1. Client calls CacheableUnaryCall twice, and compares the two responses. + The server generates a unique response (timestamp) for each request. + If the second response was delivered from cache, then both responses will + be the same. + +Client asserts: +* call was successful +* responses are the same. + ### large_unary This test verifies unary calls succeed in sending messages, and touches on flow diff --git a/src/proto/grpc/testing/test.proto b/src/proto/grpc/testing/test.proto index 84369db4b8a..b52c4cbad6c 100644 --- a/src/proto/grpc/testing/test.proto +++ b/src/proto/grpc/testing/test.proto @@ -47,6 +47,11 @@ service TestService { // One request followed by one response. rpc UnaryCall(SimpleRequest) returns (SimpleResponse); + // One request followed by one response. Response has cache control + // headers set such that a caching HTTP proxy (such as GFE) can + // satisfy subsequent requests. + rpc CacheableUnaryCall(SimpleRequest) returns (SimpleResponse); + // One request followed by a sequence of responses (streamed download). // The server returns the payload with client desired type and sizes. rpc StreamingOutputCall(StreamingOutputCallRequest) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index e8ae6ee5723..8cbb1feeafc 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -148,6 +148,8 @@ int main(int argc, char** argv) { client.DoStatusWithMessage(); } else if (FLAGS_test_case == "custom_metadata") { client.DoCustomMetadata(); + } else if (FLAGS_test_case == "cacheable_unary") { + client.DoCacheableUnary(); } else if (FLAGS_test_case == "all") { client.DoEmpty(); client.DoLargeUnary(); @@ -165,6 +167,7 @@ int main(int argc, char** argv) { client.DoEmptyStream(); client.DoStatusWithMessage(); client.DoCustomMetadata(); + client.DoCacheableUnary(); // service_account_creds and jwt_token_creds can only run with ssl. if (FLAGS_use_tls) { grpc::string json_key = GetServiceAccountJsonKey(); @@ -176,6 +179,7 @@ int main(int argc, char** argv) { // compute_engine_creds only runs in GCE. } else { const char* testcases[] = {"all", + "cacheable_unary", "cancel_after_begin", "cancel_after_first_response", "client_compressed_streaming", diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 8861bc1163c..f2290adfc3b 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -845,6 +845,49 @@ bool InteropClient::DoStatusWithMessage() { return true; } +bool InteropClient::DoCacheableUnary() { + gpr_log(GPR_DEBUG, "Sending RPC with cacheable response"); + + SimpleRequest request; + request.set_response_size(16); + grpc::string payload(16, '\0'); + request.mutable_payload()->set_body(payload.c_str(), 16); + + // Request 1 + ClientContext context1; + SimpleResponse response1; + context1.set_cacheable(true); + // Add fake user IP since some proxy's (GFE) won't cache requests from + // localhost. + context1.AddMetadata("x-user-ip", "1.2.3.4"); + Status s1 = + serviceStub_.Get()->CacheableUnaryCall(&context1, request, &response1); + if (!AssertStatusOk(s1)) { + return false; + } + gpr_log(GPR_DEBUG, "response 1 payload: %s", + response1.payload().body().c_str()); + + // Request 2 + ClientContext context2; + SimpleResponse response2; + context2.set_cacheable(true); + context2.AddMetadata("x-user-ip", "1.2.3.4"); + Status s2 = + serviceStub_.Get()->CacheableUnaryCall(&context2, request, &response2); + if (!AssertStatusOk(s2)) { + return false; + } + gpr_log(GPR_DEBUG, "response 1 payload: %s", + response2.payload().body().c_str()); + + // Check that the body is same for both requests. It will be the same if the + // second response is a cached copy of the first response + GPR_ASSERT(response2.payload().body() == response1.payload().body()); + + return true; +} + bool InteropClient::DoCustomMetadata() { const grpc::string kEchoInitialMetadataKey("x-grpc-test-echo-initial"); const grpc::string kInitialMetadataValue("test_initial_metadata_value"); diff --git a/test/cpp/interop/interop_client.h b/test/cpp/interop/interop_client.h index eb886fcb7e2..1e89f0987d5 100644 --- a/test/cpp/interop/interop_client.h +++ b/test/cpp/interop/interop_client.h @@ -79,6 +79,7 @@ class InteropClient { bool DoEmptyStream(); bool DoStatusWithMessage(); bool DoCustomMetadata(); + bool DoCacheableUnary(); // Auth tests. // username is a string containing the user email bool DoJwtTokenCreds(const grpc::string& username); diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index e5878bb248c..ac2567eba02 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -47,6 +47,7 @@ #include #include +#include "src/core/lib/support/string.h" #include "src/core/lib/transport/byte_stream.h" #include "src/proto/grpc/testing/empty.grpc.pb.h" #include "src/proto/grpc/testing/messages.grpc.pb.h" @@ -152,6 +153,16 @@ class TestServiceImpl : public TestService::Service { return Status::OK; } + // Response contains current timestamp. We ignore everything in the request. + Status CacheableUnaryCall(ServerContext* context, const SimpleRequest* request, + SimpleResponse* response) { + gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); + std::string timestamp = std::to_string(ts.tv_nsec); + response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); + context->AddInitialMetadata("Cache-Control", "max-age=100000, public"); + return Status::OK; + } + Status UnaryCall(ServerContext* context, const SimpleRequest* request, SimpleResponse* response) { MaybeEchoMetadata(context); From 42511cfd8b7c56c176c819311ea4dd4ade4df960 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Tue, 27 Sep 2016 18:15:54 -0700 Subject: [PATCH 02/12] Addressed review feedback 1. modified documentation 2. changed test slightly to make it more robust to accidental cache hits --- doc/interop-test-descriptions.md | 27 +++++++++++++++++++-------- test/cpp/interop/interop_client.cc | 9 +++++---- test/cpp/interop/interop_server.cc | 2 +- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 5b3ad2335cc..e3a41b12958 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -65,21 +65,21 @@ ensure that the proto serialized to zero bytes.* This test verifies that gRPC requests marked as cacheable use GET verb instead of POST, and that server sets appropriate cache control headers for the response to be cached by a proxy. This interop test requires that the server is behind -a caching proxy. It is NOT expected to pass if client is accessing the server -directly. +a caching proxy. Use of current timestamp in the request prevents accidental +cache matches left over from previous tests. Server features: * [CacheableUnaryCall][] Procedure: - 1. Client calls CacheableUnaryCall twice, and compares the two responses. - The server generates a unique response (timestamp) for each request. - If the second response was delivered from cache, then both responses will - be the same. + 1. Client calls CacheableUnaryCall with `SimpleRequest` request with payload + set to current timestamp. + 2. Client calls CacheableUnaryCall with `SimpleRequest` request again + immediately with the same payload as the previous request. Client asserts: -* call was successful -* responses are the same. +* Both calls were successful +* The payload body of both responses is the same. ### large_unary @@ -962,6 +962,17 @@ payload body of size `SimpleRequest.response_size` bytes and type as appropriate for the `SimpleRequest.response_type`. If the server does not support the `response_type`, then it should fail the RPC with `INVALID_ARGUMENT`. +### CacheableUnaryCall + +Server gets the default Empty proto as the request. It returns the +SimpleResponse proto with the payload set to current timestamp string. +In addition it adds + 1. cache control headers such that the response can be cached by proxies in + the response path. Server should be behind a caching proxy for this test + to pass. + 2. adds a `x-user-ip` header with `1.2.3.4` to the response. This is done + since some proxys such as GFE will not cache requests from localhost. + ### CompressedResponse [CompressedResponse]: #compressedresponse diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index f2290adfc3b..49ecf2620e2 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -848,10 +848,11 @@ bool InteropClient::DoStatusWithMessage() { bool InteropClient::DoCacheableUnary() { gpr_log(GPR_DEBUG, "Sending RPC with cacheable response"); + // Create request with current timestamp + gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); + std::string timestamp = std::to_string(ts.tv_nsec); SimpleRequest request; - request.set_response_size(16); - grpc::string payload(16, '\0'); - request.mutable_payload()->set_body(payload.c_str(), 16); + request.mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); // Request 1 ClientContext context1; @@ -878,7 +879,7 @@ bool InteropClient::DoCacheableUnary() { if (!AssertStatusOk(s2)) { return false; } - gpr_log(GPR_DEBUG, "response 1 payload: %s", + gpr_log(GPR_DEBUG, "response 2 payload: %s", response2.payload().body().c_str()); // Check that the body is same for both requests. It will be the same if the diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index ac2567eba02..64eec4241af 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -159,7 +159,7 @@ class TestServiceImpl : public TestService::Service { gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); std::string timestamp = std::to_string(ts.tv_nsec); response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); - context->AddInitialMetadata("Cache-Control", "max-age=100000, public"); + context->AddInitialMetadata("cache-control", "max-age=100000, public"); return Status::OK; } From a04c6789632c1e454cfe563f3144c27498d5ef0a Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 28 Sep 2016 08:43:00 -0700 Subject: [PATCH 03/12] trivial doc fix. --- doc/interop-test-descriptions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index e3a41b12958..8a1e93eee02 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -964,9 +964,9 @@ for the `SimpleRequest.response_type`. If the server does not support the ### CacheableUnaryCall -Server gets the default Empty proto as the request. It returns the -SimpleResponse proto with the payload set to current timestamp string. -In addition it adds +Server gets the default SimpleRequest proto as the request. The content of the +request are ignored. It returns the SimpleResponse proto with the payload set +to current timestamp string. In addition it adds 1. cache control headers such that the response can be cached by proxies in the response path. Server should be behind a caching proxy for this test to pass. From 012fc18be93b98967a20986469eada34eac0c061 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 28 Sep 2016 10:46:27 -0700 Subject: [PATCH 04/12] doc fixes and max-age set to 60 --- doc/interop-test-descriptions.md | 15 +++++++++------ test/cpp/interop/interop_server.cc | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 8a1e93eee02..62d36708f93 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -67,13 +67,17 @@ of POST, and that server sets appropriate cache control headers for the response to be cached by a proxy. This interop test requires that the server is behind a caching proxy. Use of current timestamp in the request prevents accidental cache matches left over from previous tests. +Note that client adds a `x-user-ip` header with value `1.2.3.4` to the request. +This is done since some proxys such as GFE will not cache requests from +localhost. Server features: * [CacheableUnaryCall][] Procedure: 1. Client calls CacheableUnaryCall with `SimpleRequest` request with payload - set to current timestamp. + set to current timestamp. Timestamp format is irrelevant, and resolution is + in nanoseconds. 2. Client calls CacheableUnaryCall with `SimpleRequest` request again immediately with the same payload as the previous request. @@ -965,13 +969,12 @@ for the `SimpleRequest.response_type`. If the server does not support the ### CacheableUnaryCall Server gets the default SimpleRequest proto as the request. The content of the -request are ignored. It returns the SimpleResponse proto with the payload set -to current timestamp string. In addition it adds +request is ignored. It returns the SimpleResponse proto with the payload set +to current timestamp. The timestamp is an integer representing current time +with nanosecond resolution. In addition it adds 1. cache control headers such that the response can be cached by proxies in the response path. Server should be behind a caching proxy for this test - to pass. - 2. adds a `x-user-ip` header with `1.2.3.4` to the response. This is done - since some proxys such as GFE will not cache requests from localhost. + to pass. Currently we set the max-age to 60 seconds. ### CompressedResponse [CompressedResponse]: #compressedresponse diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index 64eec4241af..06d1bdb7965 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -159,7 +159,7 @@ class TestServiceImpl : public TestService::Service { gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); std::string timestamp = std::to_string(ts.tv_nsec); response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); - context->AddInitialMetadata("cache-control", "max-age=100000, public"); + context->AddInitialMetadata("cache-control", "max-age=60, public"); return Status::OK; } From ed3e86b7d907c0d09ce70d794cb964c5a4a2a53e Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 28 Sep 2016 10:55:49 -0700 Subject: [PATCH 05/12] added comment about setting cacheable flag. --- doc/interop-test-descriptions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 62d36708f93..19947b3c60d 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -70,6 +70,10 @@ cache matches left over from previous tests. Note that client adds a `x-user-ip` header with value `1.2.3.4` to the request. This is done since some proxys such as GFE will not cache requests from localhost. +Note also that the client request needs to marked as cacheable. For now this is +achieved by setting the cacheable flag in the request context to 'true'.Longer +term this will be automatically set via method options specified in the proto +file. Server features: * [CacheableUnaryCall][] From 1bb6e68fde7266c0ff626b4d0fcc735d1710d9c0 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 28 Sep 2016 11:16:15 -0700 Subject: [PATCH 06/12] more doc fixes --- doc/interop-test-descriptions.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 19947b3c60d..92824df23d6 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -67,13 +67,6 @@ of POST, and that server sets appropriate cache control headers for the response to be cached by a proxy. This interop test requires that the server is behind a caching proxy. Use of current timestamp in the request prevents accidental cache matches left over from previous tests. -Note that client adds a `x-user-ip` header with value `1.2.3.4` to the request. -This is done since some proxys such as GFE will not cache requests from -localhost. -Note also that the client request needs to marked as cacheable. For now this is -achieved by setting the cacheable flag in the request context to 'true'.Longer -term this will be automatically set via method options specified in the proto -file. Server features: * [CacheableUnaryCall][] @@ -82,8 +75,15 @@ Procedure: 1. Client calls CacheableUnaryCall with `SimpleRequest` request with payload set to current timestamp. Timestamp format is irrelevant, and resolution is in nanoseconds. + Client adds a `x-user-ip` header with value `1.2.3.4` to the request. + This is done since some proxys such as GFE will not cache requests from + localhost. + Client marks the request as cacheable by setting the cacheable flag in the + request context. Longer term this should be driven by the method option + specified in the proto file itself. 2. Client calls CacheableUnaryCall with `SimpleRequest` request again - immediately with the same payload as the previous request. + immediately with the same payload as the previous request. Cacheable flat is + also set for this request's context. Client asserts: * Both calls were successful @@ -975,7 +975,9 @@ for the `SimpleRequest.response_type`. If the server does not support the Server gets the default SimpleRequest proto as the request. The content of the request is ignored. It returns the SimpleResponse proto with the payload set to current timestamp. The timestamp is an integer representing current time -with nanosecond resolution. In addition it adds +with nanosecond resolution. This integer is formated as ASCII decimal in the +response. The format is not really important as long as the response payload +is different for each request. In addition it adds 1. cache control headers such that the response can be cached by proxies in the response path. Server should be behind a caching proxy for this test to pass. Currently we set the max-age to 60 seconds. From af564a1e920af86260a8003e20091c9eaa4e1c81 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 28 Sep 2016 12:50:37 -0700 Subject: [PATCH 07/12] changed timestamp clock from REALTIME to PRECISE to increase robustness --- test/cpp/interop/interop_client.cc | 2 +- test/cpp/interop/interop_server.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 49ecf2620e2..f323090ebf0 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -849,7 +849,7 @@ bool InteropClient::DoCacheableUnary() { gpr_log(GPR_DEBUG, "Sending RPC with cacheable response"); // Create request with current timestamp - gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); + gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE); std::string timestamp = std::to_string(ts.tv_nsec); SimpleRequest request; request.mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index 06d1bdb7965..e5e62dfc1ae 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -156,7 +156,7 @@ class TestServiceImpl : public TestService::Service { // Response contains current timestamp. We ignore everything in the request. Status CacheableUnaryCall(ServerContext* context, const SimpleRequest* request, SimpleResponse* response) { - gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); + gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE); std::string timestamp = std::to_string(ts.tv_nsec); response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); context->AddInitialMetadata("cache-control", "max-age=60, public"); From b6cf4944a5f4fda11f240b3c1b9736c61d299e5b Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Fri, 30 Sep 2016 10:49:57 -0700 Subject: [PATCH 08/12] s/flat/flag --- doc/interop-test-descriptions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 92824df23d6..97d76191a8f 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -82,7 +82,7 @@ Procedure: request context. Longer term this should be driven by the method option specified in the proto file itself. 2. Client calls CacheableUnaryCall with `SimpleRequest` request again - immediately with the same payload as the previous request. Cacheable flat is + immediately with the same payload as the previous request. Cacheable flag is also set for this request's context. Client asserts: From c9beacadb1f9b0cd8858ce59d6cbed01b7f48cd3 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Fri, 30 Sep 2016 11:26:13 -0700 Subject: [PATCH 09/12] fix for gcc 4.4 warning --- test/cpp/interop/interop_server.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index e5e62dfc1ae..b58b744b920 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -157,7 +157,7 @@ class TestServiceImpl : public TestService::Service { Status CacheableUnaryCall(ServerContext* context, const SimpleRequest* request, SimpleResponse* response) { gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE); - std::string timestamp = std::to_string(ts.tv_nsec); + std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec); response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); context->AddInitialMetadata("cache-control", "max-age=60, public"); return Status::OK; From b58c2db6167cee26327e611ffccba499b8bd7015 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Fri, 30 Sep 2016 16:21:11 -0700 Subject: [PATCH 10/12] yet another gcc 4.4 compile fix. --- test/cpp/interop/interop_client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index f323090ebf0..2fbd6a98cdc 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -850,7 +850,7 @@ bool InteropClient::DoCacheableUnary() { // Create request with current timestamp gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE); - std::string timestamp = std::to_string(ts.tv_nsec); + std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec); SimpleRequest request; request.mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); From 82d7677ec9104e6e3bf57097591ef322758e6cfb Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 12 Oct 2016 10:28:31 -0700 Subject: [PATCH 11/12] trivial change to kick off jenkins run --- doc/interop-test-descriptions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 97d76191a8f..666af185b9f 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -64,7 +64,7 @@ ensure that the proto serialized to zero bytes.* This test verifies that gRPC requests marked as cacheable use GET verb instead of POST, and that server sets appropriate cache control headers for the response -to be cached by a proxy. This interop test requires that the server is behind +to be cached by a proxy. This test requires that the server is behind a caching proxy. Use of current timestamp in the request prevents accidental cache matches left over from previous tests. From b5299976c14781bc98890a0c2d4b6513804c264e Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 12 Oct 2016 14:13:42 -0700 Subject: [PATCH 12/12] Fixed clang-format sanity error --- test/cpp/interop/interop_server.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index 05af18bc671..58f20aa611a 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -155,8 +155,9 @@ class TestServiceImpl : public TestService::Service { } // Response contains current timestamp. We ignore everything in the request. - Status CacheableUnaryCall(ServerContext* context, const SimpleRequest* request, - SimpleResponse* response) { + Status CacheableUnaryCall(ServerContext* context, + const SimpleRequest* request, + SimpleResponse* response) { gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE); std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec); response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size());