Addressed review feedback
1. modified documentation
2. changed test slightly to make it more robust to accidental cache hits
diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc
index f2290ad..49ecf26 100644
--- a/test/cpp/interop/interop_client.cc
+++ b/test/cpp/interop/interop_client.cc
@@ -848,10 +848,11 @@
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 @@
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 ac2567e..64eec42 100644
--- a/test/cpp/interop/interop_server.cc
+++ b/test/cpp/interop/interop_server.cc
@@ -159,7 +159,7 @@
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;
}