From 5de1616336c02de75482f22f20bb7b078bf521fa Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 17 Nov 2015 09:39:39 -0800 Subject: Fix naming issue in stress_test (via ahh@google.com) Under some configurations gRPC includes google3 base headers. google3 has a namespace "thread" which mixes poorly with unqualified use of the type std::thread; adding that namespace to various google3 headers breaks this test. --- test/cpp/interop/stress_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/cpp') diff --git a/test/cpp/interop/stress_test.cc b/test/cpp/interop/stress_test.cc index 5d1419728e..772204e9ca 100644 --- a/test/cpp/interop/stress_test.cc +++ b/test/cpp/interop/stress_test.cc @@ -202,7 +202,7 @@ int main(int argc, char** argv) { gpr_log(GPR_INFO, "Starting test(s).."); - vector test_threads; + vector test_threads; int thread_idx = 0; for (auto it = server_addresses.begin(); it != server_addresses.end(); it++) { StressTestInteropClient* client = new StressTestInteropClient( @@ -210,7 +210,7 @@ int main(int argc, char** argv) { FLAGS_sleep_duration_ms); test_threads.emplace_back( - thread(&StressTestInteropClient::MainLoop, client)); + std::thread(&StressTestInteropClient::MainLoop, client)); } for (auto it = test_threads.begin(); it != test_threads.end(); it++) { -- cgit v1.2.3 From 5dc96fb5b839ddb8fdb225cc5aca3ad66a85d0c9 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 17 Nov 2015 09:58:34 -0800 Subject: Comments --- test/cpp/interop/stress_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/cpp') diff --git a/test/cpp/interop/stress_test.cc b/test/cpp/interop/stress_test.cc index 772204e9ca..018f4ab4f7 100644 --- a/test/cpp/interop/stress_test.cc +++ b/test/cpp/interop/stress_test.cc @@ -41,6 +41,7 @@ #include #include #include +#include #include "test/cpp/interop/interop_client.h" #include "test/cpp/interop/stress_interop_client.h" @@ -80,7 +81,6 @@ DEFINE_string(test_cases, "", using std::make_pair; using std::pair; -using std::thread; using std::vector; using grpc::testing::kTestCaseList; @@ -202,7 +202,7 @@ int main(int argc, char** argv) { gpr_log(GPR_INFO, "Starting test(s).."); - vector test_threads; + vector test_threads; int thread_idx = 0; for (auto it = server_addresses.begin(); it != server_addresses.end(); it++) { StressTestInteropClient* client = new StressTestInteropClient( @@ -210,7 +210,7 @@ int main(int argc, char** argv) { FLAGS_sleep_duration_ms); test_threads.emplace_back( - std::thread(&StressTestInteropClient::MainLoop, client)); + grpc::thread(&StressTestInteropClient::MainLoop, client)); } for (auto it = test_threads.begin(); it != test_threads.end(); it++) { -- cgit v1.2.3