From de91fc1d67582dcfef82489d7dc9ab7548539d3c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 18 May 2015 14:42:15 -0700 Subject: [PATCH 1/4] Run qps smoke tests on Travis --- Makefile | 8 ++++++++ build.json | 4 ---- tools/run_tests/tests.json | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 45910714137..ef3cb353be4 100644 --- a/Makefile +++ b/Makefile @@ -1845,6 +1845,10 @@ test_c: buildtests_c test_cxx: buildtests_cxx $(E) "[RUN] Testing async_end2end_test" $(Q) $(BINDIR)/$(CONFIG)/async_end2end_test || ( echo test async_end2end_test failed ; exit 1 ) + $(E) "[RUN] Testing async_streaming_ping_pong_test" + $(Q) $(BINDIR)/$(CONFIG)/async_streaming_ping_pong_test || ( echo test async_streaming_ping_pong_test failed ; exit 1 ) + $(E) "[RUN] Testing async_unary_ping_pong_test" + $(Q) $(BINDIR)/$(CONFIG)/async_unary_ping_pong_test || ( echo test async_unary_ping_pong_test failed ; exit 1 ) $(E) "[RUN] Testing channel_arguments_test" $(Q) $(BINDIR)/$(CONFIG)/channel_arguments_test || ( echo test channel_arguments_test failed ; exit 1 ) $(E) "[RUN] Testing cli_call_test" @@ -1863,6 +1867,10 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/mock_test || ( echo test mock_test failed ; exit 1 ) $(E) "[RUN] Testing status_test" $(Q) $(BINDIR)/$(CONFIG)/status_test || ( echo test status_test failed ; exit 1 ) + $(E) "[RUN] Testing sync_streaming_ping_pong_test" + $(Q) $(BINDIR)/$(CONFIG)/sync_streaming_ping_pong_test || ( echo test sync_streaming_ping_pong_test failed ; exit 1 ) + $(E) "[RUN] Testing sync_unary_ping_pong_test" + $(Q) $(BINDIR)/$(CONFIG)/sync_unary_ping_pong_test || ( echo test sync_unary_ping_pong_test failed ; exit 1 ) $(E) "[RUN] Testing thread_pool_test" $(Q) $(BINDIR)/$(CONFIG)/thread_pool_test || ( echo test thread_pool_test failed ; exit 1 ) $(E) "[RUN] Testing thread_stress_test" diff --git a/build.json b/build.json index 18c0eb1211d..8a7e65b99ab 100644 --- a/build.json +++ b/build.json @@ -1813,7 +1813,6 @@ { "name": "async_streaming_ping_pong_test", "build": "test", - "run": false, "language": "c++", "src": [ "test/cpp/qps/async_streaming_ping_pong_test.cc" @@ -1831,7 +1830,6 @@ { "name": "async_unary_ping_pong_test", "build": "test", - "run": false, "language": "c++", "src": [ "test/cpp/qps/async_unary_ping_pong_test.cc" @@ -2207,7 +2205,6 @@ { "name": "sync_streaming_ping_pong_test", "build": "test", - "run": false, "language": "c++", "src": [ "test/cpp/qps/sync_streaming_ping_pong_test.cc" @@ -2225,7 +2222,6 @@ { "name": "sync_unary_ping_pong_test", "build": "test", - "run": false, "language": "c++", "src": [ "test/cpp/qps/sync_unary_ping_pong_test.cc" diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index d161041c1f6..398672f3090 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -596,6 +596,24 @@ "posix" ] }, + { + "flaky": false, + "language": "c++", + "name": "async_streaming_ping_pong_test", + "platforms": [ + "windows", + "posix" + ] + }, + { + "flaky": false, + "language": "c++", + "name": "async_unary_ping_pong_test", + "platforms": [ + "windows", + "posix" + ] + }, { "flaky": false, "language": "c++", @@ -677,6 +695,24 @@ "posix" ] }, + { + "flaky": false, + "language": "c++", + "name": "sync_streaming_ping_pong_test", + "platforms": [ + "windows", + "posix" + ] + }, + { + "flaky": false, + "language": "c++", + "name": "sync_unary_ping_pong_test", + "platforms": [ + "windows", + "posix" + ] + }, { "flaky": false, "language": "c++", From f98e56c91bc4ffc3fc5c484da0c12fa315a408d8 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 18 May 2015 15:00:52 -0700 Subject: [PATCH 2/4] Cheesy attempt to get this working on Travis --- test/cpp/qps/driver.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index 9f7d3b56a44..6843e719e1c 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -44,6 +44,7 @@ #include #include #include +#include #include "test/cpp/qps/histogram.h" #include "test/cpp/qps/qps_worker.h" #include "test/core/util/port.h" @@ -89,6 +90,8 @@ ScenarioResult RunScenario(const ClientConfig& initial_client_config, return &contexts.back(); }; + srand(time(NULL) ^ getpid()); + // Get client, server lists auto workers = get_hosts("QPS_WORKERS"); ClientConfig client_config = initial_client_config; From 49c3b01c3e61efb0128c5ae0175b653a23ea86db Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 19 May 2015 08:18:02 -0700 Subject: [PATCH 3/4] Better RNG seeding portability --- test/cpp/qps/driver.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index 6843e719e1c..08a32f0823e 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -90,8 +90,6 @@ ScenarioResult RunScenario(const ClientConfig& initial_client_config, return &contexts.back(); }; - srand(time(NULL) ^ getpid()); - // Get client, server lists auto workers = get_hosts("QPS_WORKERS"); ClientConfig client_config = initial_client_config; @@ -99,6 +97,14 @@ ScenarioResult RunScenario(const ClientConfig& initial_client_config, // Spawn some local workers if desired vector> local_workers; for (int i = 0; i < abs(spawn_local_worker_count); i++) { + // act as if we're a new test -- gets a good rng seed + static bool called_init = false; + if (!called_init) { + char *args[] = {"some-benchmark"}; + grpc_test_init(1, args); + called_init = true; + } + int driver_port = grpc_pick_unused_port_or_die(); int benchmark_port = grpc_pick_unused_port_or_die(); local_workers.emplace_back(new QpsWorker(driver_port, benchmark_port)); From 882431fff5c06eed97633353016cbcac9361a2e2 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 19 May 2015 09:25:37 -0700 Subject: [PATCH 4/4] Compile fix --- test/cpp/qps/driver.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index 08a32f0823e..6959f980ae2 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -48,6 +48,7 @@ #include "test/cpp/qps/histogram.h" #include "test/cpp/qps/qps_worker.h" #include "test/core/util/port.h" +#include "test/core/util/test_config.h" using std::list; using std::thread; @@ -100,7 +101,9 @@ ScenarioResult RunScenario(const ClientConfig& initial_client_config, // act as if we're a new test -- gets a good rng seed static bool called_init = false; if (!called_init) { - char *args[] = {"some-benchmark"}; + char args_buf[100]; + strcpy(args_buf, "some-benchmark"); + char *args[] = {args_buf}; grpc_test_init(1, args); called_init = true; }