1818#include " google/cloud/testing_util/fake_clock.h"
1919#include " google/cloud/testing_util/fake_completion_queue_impl.h"
2020#include " google/cloud/testing_util/is_proto_equal.h"
21- #include " google/cloud/testing_util/mock_completion_queue_impl.h"
2221#include " google/cloud/testing_util/status_matchers.h"
2322#include < google/bigtable/v2/data.pb.h>
2423#include < google/protobuf/text_format.h>
@@ -32,12 +31,10 @@ namespace bigtable_internal {
3231GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
3332namespace {
3433
35- using ::google::cloud::internal::ToProtoTimestamp;
3634using ::google::cloud::testing_util::FakeCompletionQueueImpl;
3735using ::google::cloud::testing_util::FakeSystemClock;
3836using ::google::cloud::testing_util::IsProtoEqual;
3937using ::google::cloud::testing_util::StatusIs;
40- using ::google::protobuf::util::TimeUtil;
4138
4239TEST (QueryPlanTest, ResponseDataWithOriginalValidQueryPlan) {
4340 auto fake_cq_impl = std::make_shared<FakeCompletionQueueImpl>();
@@ -57,8 +54,6 @@ TEST(QueryPlanTest, ResponseDataWithOriginalValidQueryPlan) {
5754 ASSERT_TRUE (google::protobuf::TextFormat::ParseFromString (kResultMetadataText ,
5855 &metadata));
5956 *response.mutable_metadata () = metadata;
60- *response.mutable_valid_until () =
61- TimeUtil::GetCurrentTime () + TimeUtil::SecondsToDuration (300 );
6257
6358 auto plan = QueryPlan::Create (cq, response, [] {
6459 return make_ready_future (
@@ -88,8 +83,6 @@ TEST(QueryPlanTest, RefreshExpiredPlan) {
8883
8984 google::bigtable::v2::PrepareQueryResponse response;
9085 response.set_prepared_query (" original-query-plan" );
91- *response.mutable_valid_until () =
92- ToProtoTimestamp (now + std::chrono::seconds (600 ));
9386
9487 auto query_plan = QueryPlan::Create (CompletionQueue (fake_cq_impl), response,
9588 refresh_fn, fake_clock);
@@ -98,7 +91,6 @@ TEST(QueryPlanTest, RefreshExpiredPlan) {
9891 ASSERT_STATUS_OK (data);
9992 EXPECT_EQ (data->prepared_query (), " original-query-plan" );
10093
101- fake_clock->AdvanceTime (std::chrono::seconds (500 ));
10294 fake_cq_impl->SimulateCompletion (true );
10395
10496 data = query_plan->response ();
@@ -123,8 +115,6 @@ TEST(QueryPlanTest, FailedRefreshExpiredPlan) {
123115
124116 google::bigtable::v2::PrepareQueryResponse response;
125117 response.set_prepared_query (" original-query-plan" );
126- *response.mutable_valid_until () =
127- ToProtoTimestamp (now + std::chrono::seconds (600 ));
128118
129119 auto query_plan = QueryPlan::Create (CompletionQueue (fake_cq_impl), response,
130120 refresh_fn, fake_clock);
@@ -133,7 +123,6 @@ TEST(QueryPlanTest, FailedRefreshExpiredPlan) {
133123 ASSERT_STATUS_OK (data);
134124 EXPECT_EQ (data->prepared_query (), " original-query-plan" );
135125
136- fake_clock->AdvanceTime (std::chrono::seconds (500 ));
137126 fake_cq_impl->SimulateCompletion (true );
138127
139128 data = query_plan->response ();
@@ -157,8 +146,6 @@ TEST(QueryPlanTest, RefreshInvalidatedPlan) {
157146
158147 google::bigtable::v2::PrepareQueryResponse response;
159148 response.set_prepared_query (" original-query-plan" );
160- *response.mutable_valid_until () =
161- ToProtoTimestamp (now + std::chrono::seconds (600 ));
162149
163150 auto query_plan = QueryPlan::Create (CompletionQueue (fake_cq_impl), response,
164151 refresh_fn, fake_clock);
@@ -192,8 +179,6 @@ TEST(QueryPlanTest, FailedRefreshInvalidatedPlan) {
192179
193180 google::bigtable::v2::PrepareQueryResponse response;
194181 response.set_prepared_query (" original-query-plan" );
195- *response.mutable_valid_until () =
196- ToProtoTimestamp (now + std::chrono::seconds (600 ));
197182
198183 auto query_plan = QueryPlan::Create (CompletionQueue (fake_cq_impl), response,
199184 refresh_fn, fake_clock);
0 commit comments