diff options
author | 2015-04-30 13:49:18 -0700 | |
---|---|---|
committer | 2015-04-30 13:49:18 -0700 | |
commit | 12608921f636654984a91aa1ddde16d18e61c158 (patch) | |
tree | 5b006d47445a2108913b0412865fcc0c6762fe1e | |
parent | 06eb5ae1575c05818781facadf082b3f8a39d75b (diff) | |
parent | 76dcd383322af43ad34d7af0f003283dbcdedee0 (diff) |
Merge branch 'delete-the-old-api' of github.com:ctiller/grpc into delete-the-old-api
-rw-r--r-- | src/cpp/common/completion_queue.cc | 2 | ||||
-rw-r--r-- | test/cpp/end2end/end2end_test.cc | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/cpp/common/completion_queue.cc b/src/cpp/common/completion_queue.cc index 07122db4a5..2b9000ea08 100644 --- a/src/cpp/common/completion_queue.cc +++ b/src/cpp/common/completion_queue.cc @@ -92,7 +92,7 @@ bool CompletionQueue::Pluck(CompletionQueueTag* tag) { void CompletionQueue::TryPluck(CompletionQueueTag* tag) { std::unique_ptr<grpc_event, EventDeleter> ev; - ev.reset(grpc_completion_queue_pluck(cq_, tag, gpr_inf_past)); + ev.reset(grpc_completion_queue_pluck(cq_, tag, gpr_time_0)); if (!ev) return; bool ok = ev->data.op_complete == GRPC_OP_OK; void* ignored = tag; diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 5e89490ecb..93d7ace9a2 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -576,6 +576,17 @@ TEST_F(End2endTest, ClientCancelsBidi) { EXPECT_EQ(grpc::StatusCode::CANCELLED, s.code()); } +TEST_F(End2endTest, ThreadStress) { + ResetStub(); + std::vector<std::thread*> threads; + for (int i = 0; i < 100; ++i) { + threads.push_back(new std::thread(SendRpc, stub_.get(), 1000)); + } + for (int i = 0; i < 100; ++i) { + threads[i]->join(); + delete threads[i]; + } +} } // namespace testing } // namespace grpc |