From 528e2896f451b83e64542eb2c2535f10f9ba04f3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 21 May 2015 16:29:52 -0700 Subject: [PATCH 01/27] update C# readme --- src/csharp/README.md | 77 +++++++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 19 deletions(-) diff --git a/src/csharp/README.md b/src/csharp/README.md index 37aa2ecddcd..43d519349f4 100644 --- a/src/csharp/README.md +++ b/src/csharp/README.md @@ -6,7 +6,7 @@ A C# implementation of gRPC. Status ------ -Ready for early adopters. +Alpha : Ready for early adopters. Usage: Windows -------------- @@ -19,22 +19,60 @@ Usage: Windows That will also pull all the transitive dependencies (including the native libraries that gRPC C# is internally using). -- TODO: link to Helloworld example +- Helloworld project example can be found in https://github.com/grpc/grpc-common/tree/master/csharp. Usage: Linux (Mono) -------------- -- Prerequisites: Mono framework, MonoDevelop 5.9 with NuGet add-in installed. +- Prerequisites: Mono 3.2.8+, MonoDevelop 5.9 with NuGet add-in installed. -- Install gRPC C Core using instructions in https://github.com/grpc/homebrew-grpc +- Install Linuxbrew and gRPC C Core using instructions in https://github.com/grpc/homebrew-grpc -- TODO: explain using LD_LIBRARY_PATH or installation to /usr/local +- gRPC C# depends on native shared library libgrpc_csharp_ext.so (Unix flavor of grpc_csharp_ext.dll). + This library will be installed to `~/.linuxbrew/lib` by the previous step. + To make it visible to mono, you need to: + + - (preferred approach) add `libgrpc_csharp_ext.so` to `/etc/ld.so.cache` by running: + + ```sh + echo "$HOME/.linuxbrew/lib" | sudo tee /etc/ld.so.conf.d/zzz_brew_lib.conf + sudo ldconfig + ``` + + - (adhoc approach) set `LD_LIBRARY_PATH` environment variable to point to directory containing `libgrpc_csharp_ext.so`: + + ```sh + export LD_LIBRARY_PATH=$HOME/.linuxbrew/lib:${LD_LIBRARY_PATH} + ``` - Open MonoDevelop and start a new project/solution. - Add NuGet package `Grpc` as a dependency (Project -> Add NuGet packages). -- TODO: link to Helloworld example +- Helloworld project example can be found in https://github.com/grpc/grpc-common/tree/master/csharp. + +Usage: MacOS (Mono) +-------------- + +- WARNING: As of now gRPC C# only works on 64bit version of Mono (because we don't compile + the native extension for C# in 32bit mode yet). That means your development experience + with Xamarin Studio on MacOS will not be great, as you won't be able to run your + code directly from Xamarin Studio (which requires 32bit version of Mono). + +- Prerequisites: Xamarin Studio with NuGet add-in installed. + +- Install Homebrew and gRPC C Core using instructions in https://github.com/grpc/homebrew-grpc + +- Install 64-bit version of mono with command `brew install mono` (assumes you've already installed Homebrew). + +- Open Xamarin Studio and start a new project/solution. + +- Add NuGet package `Grpc` as a dependency (Project -> Add NuGet packages). + +- *You will be able to build your project in Xamarin Studio, but to run or test it, + you will need to run it under 64-bit version of Mono.* + +- Helloworld project example can be found in https://github.com/grpc/grpc-common/tree/master/csharp. Building: Windows ----------------- @@ -47,9 +85,10 @@ If you are a user of gRPC C#, go to Usage section above. - The grpc_csharp_ext native library needs to be built so you can build the Grpc C# solution. You can either build the native solution in `vsprojects/grpc.sln` from Visual Studio manually, or you can use a convenience batch script that builds everything for you. -``` -buildall.bat -``` + + ``` + buildall.bat + ``` - Open Grpc.sln using Visual Studio 2013. NuGet dependencies will be restored upon build (you need to have NuGet add-in installed). @@ -61,11 +100,12 @@ Building: Linux & Mono You only need to go through these steps if you are planning to develop gRPC C#. If you are a user of gRPC C#, go to Usage section above. -- Prerequisites for development: Mono framework, MonoDevelop 5.9 with NuGet and Nunit add-ins installed. -``` -sudo apt-get install mono-devel -sudo apt-get install nunit nunit-console -``` +- Prerequisites for development: Mono 3.2.8+, MonoDevelop 5.9 with NuGet and NUnit add-ins installed. + + ```sh + sudo apt-get install mono-devel + sudo apt-get install nunit nunit-console + ``` You can use older versions of MonoDevelop, but then you might need to restore NuGet dependencies manually (by `nuget restore`), because older versions of MonoDevelop @@ -73,10 +113,10 @@ don't support NuGet add-in. - Compile and install the gRPC C# extension library (that will be used via P/Invoke from C#). -``` -make grpc_csharp_ext -sudo make install_grpc_csharp_ext -``` + ```sh + make grpc_csharp_ext + sudo make install_grpc_csharp_ext + ``` - Use MonoDevelop to open the solution Grpc.sln @@ -95,7 +135,6 @@ Then you should be able to run all the test from the Test View. After building the solution, you can also run the tests from command line using nunit-console tool. - ``` # from Grpc.Core.Test/bin/Debug directory nunit-console Grpc.Core.Tests.dll From 2fb16aafa3254b42c4d53b60c0782fb627154085 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 22 May 2015 09:49:06 -0700 Subject: [PATCH 02/27] Fixed ordering assumptions in server_streaming interop test --- src/node/interop/interop_client.js | 6 ++++-- src/node/src/client.js | 8 +++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/node/interop/interop_client.js b/src/node/interop/interop_client.js index 80f811901ca..455055d9f3c 100644 --- a/src/node/interop/interop_client.js +++ b/src/node/interop/interop_client.js @@ -154,13 +154,15 @@ function serverStreaming(client, done) { arg.response_parameters[resp_index].size); resp_index += 1; }); - call.on('status', function(status) { - assert.strictEqual(status.code, grpc.status.OK); + call.on('end', function() { assert.strictEqual(resp_index, 4); if (done) { done(); } }); + call.on('status', function(status) { + assert.strictEqual(status.code, grpc.status.OK); + }); } /** diff --git a/src/node/src/client.js b/src/node/src/client.js index efec05bbf3d..be1e5347072 100644 --- a/src/node/src/client.js +++ b/src/node/src/client.js @@ -81,7 +81,7 @@ function _write(chunk, encoding, callback) { batch[grpc.opType.SEND_MESSAGE] = this.serialize(chunk); this.call.startBatch(batch, function(err, event) { if (err) { - // Something has gone wrong. Stop writing by failing to call callback + callback(err); return; } callback(); @@ -125,11 +125,9 @@ function _read(size) { self.finished = true; return; } - if (self.finished) { - self.push(null); - return; - } var data = event.read; + var deserialized = self.deserialize(data); + console.log(deserialized); if (self.push(self.deserialize(data)) && data !== null) { var read_batch = {}; read_batch[grpc.opType.RECV_MESSAGE] = true; From fe29b6dea1db08ea4edd1748f29dfc6cd35a33fd Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 22 May 2015 09:50:41 -0700 Subject: [PATCH 03/27] Removed debug log --- src/node/src/client.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/node/src/client.js b/src/node/src/client.js index be1e5347072..c9c0318b6da 100644 --- a/src/node/src/client.js +++ b/src/node/src/client.js @@ -126,8 +126,6 @@ function _read(size) { return; } var data = event.read; - var deserialized = self.deserialize(data); - console.log(deserialized); if (self.push(self.deserialize(data)) && data !== null) { var read_batch = {}; read_batch[grpc.opType.RECV_MESSAGE] = true; From 6d1a8449d1f485d6d037b397a5df7ac42218c5e9 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 22 May 2015 10:29:05 -0700 Subject: [PATCH 04/27] Coalesced redundant code --- src/node/src/client.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/node/src/client.js b/src/node/src/client.js index c9c0318b6da..9a50bf24d9c 100644 --- a/src/node/src/client.js +++ b/src/node/src/client.js @@ -80,11 +80,7 @@ function _write(chunk, encoding, callback) { var batch = {}; batch[grpc.opType.SEND_MESSAGE] = this.serialize(chunk); this.call.startBatch(batch, function(err, event) { - if (err) { - callback(err); - return; - } - callback(); + callback(err); }); } From 4251d561c6d849a13078bcb878a3fd345590a325 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 22 May 2015 19:43:39 +0200 Subject: [PATCH 05/27] Don't run flaky tests on make test. --- Makefile | 112 +++++++++++++++++++----------------- templates/Makefile.template | 24 +++++++- 2 files changed, 82 insertions(+), 54 deletions(-) diff --git a/Makefile b/Makefile index f4129859b44..d0048f2244b 100644 --- a/Makefile +++ b/Makefile @@ -1167,6 +1167,8 @@ buildtests_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/async_end2end_test $(BINDIR) test: test_c test_cxx +flaky_test: flaky_test_c flaky_test_cxx + test_c: buildtests_c $(E) "[RUN] Testing alarm_heap_test" $(Q) $(BINDIR)/$(CONFIG)/alarm_heap_test || ( echo test alarm_heap_test failed ; exit 1 ) @@ -1180,16 +1182,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/bin_encoder_test || ( echo test bin_encoder_test failed ; exit 1 ) $(E) "[RUN] Testing census_hash_table_test" $(Q) $(BINDIR)/$(CONFIG)/census_hash_table_test || ( echo test census_hash_table_test failed ; exit 1 ) - $(E) "[RUN] Testing census_statistics_multiple_writers_circular_buffer_test" - $(Q) $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_circular_buffer_test || ( echo test census_statistics_multiple_writers_circular_buffer_test failed ; exit 1 ) - $(E) "[RUN] Testing census_statistics_multiple_writers_test" - $(Q) $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_test || ( echo test census_statistics_multiple_writers_test failed ; exit 1 ) - $(E) "[RUN] Testing census_statistics_performance_test" - $(Q) $(BINDIR)/$(CONFIG)/census_statistics_performance_test || ( echo test census_statistics_performance_test failed ; exit 1 ) - $(E) "[RUN] Testing census_statistics_quick_test" - $(Q) $(BINDIR)/$(CONFIG)/census_statistics_quick_test || ( echo test census_statistics_quick_test failed ; exit 1 ) - $(E) "[RUN] Testing census_statistics_small_log_test" - $(Q) $(BINDIR)/$(CONFIG)/census_statistics_small_log_test || ( echo test census_statistics_small_log_test failed ; exit 1 ) $(E) "[RUN] Testing census_stub_test" $(Q) $(BINDIR)/$(CONFIG)/census_stub_test || ( echo test census_stub_test failed ; exit 1 ) $(E) "[RUN] Testing census_window_stats_test" @@ -1302,8 +1294,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/transport_security_test || ( echo test transport_security_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fake_security_bad_hostname_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_bad_hostname_test || ( echo test chttp2_fake_security_bad_hostname_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_fake_security_cancel_after_accept_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test || ( echo test chttp2_fake_security_cancel_after_accept_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fake_security_cancel_after_accept_and_writes_closed_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_fake_security_cancel_after_accept_and_writes_closed_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fake_security_cancel_after_invoke_test" @@ -1324,8 +1314,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_empty_batch_test || ( echo test chttp2_fake_security_empty_batch_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fake_security_graceful_server_shutdown_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_test || ( echo test chttp2_fake_security_graceful_server_shutdown_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_fake_security_invoke_large_request_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_test || ( echo test chttp2_fake_security_invoke_large_request_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fake_security_max_concurrent_streams_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_test || ( echo test chttp2_fake_security_max_concurrent_streams_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fake_security_max_message_length_test" @@ -1360,8 +1348,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_fake_security_simple_request_with_high_initial_sequence_number_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_bad_hostname_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_bad_hostname_test || ( echo test chttp2_fullstack_bad_hostname_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_fullstack_cancel_after_accept_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test || ( echo test chttp2_fullstack_cancel_after_accept_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_cancel_after_accept_and_writes_closed_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_fullstack_cancel_after_accept_and_writes_closed_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_cancel_after_invoke_test" @@ -1382,8 +1368,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_empty_batch_test || ( echo test chttp2_fullstack_empty_batch_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_graceful_server_shutdown_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_test || ( echo test chttp2_fullstack_graceful_server_shutdown_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_fullstack_invoke_large_request_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_test || ( echo test chttp2_fullstack_invoke_large_request_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_max_concurrent_streams_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_test || ( echo test chttp2_fullstack_max_concurrent_streams_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_max_message_length_test" @@ -1418,8 +1402,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_fullstack_simple_request_with_high_initial_sequence_number_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_uds_posix_bad_hostname_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_bad_hostname_test || ( echo test chttp2_fullstack_uds_posix_bad_hostname_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_fullstack_uds_posix_cancel_after_accept_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_test || ( echo test chttp2_fullstack_uds_posix_cancel_after_accept_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_uds_posix_cancel_after_invoke_test" @@ -1440,8 +1422,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_empty_batch_test || ( echo test chttp2_fullstack_uds_posix_empty_batch_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_uds_posix_graceful_server_shutdown_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_graceful_server_shutdown_test || ( echo test chttp2_fullstack_uds_posix_graceful_server_shutdown_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_fullstack_uds_posix_invoke_large_request_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_invoke_large_request_test || ( echo test chttp2_fullstack_uds_posix_invoke_large_request_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_uds_posix_max_concurrent_streams_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_max_concurrent_streams_test || ( echo test chttp2_fullstack_uds_posix_max_concurrent_streams_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_uds_posix_max_message_length_test" @@ -1476,8 +1456,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_bad_hostname_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_bad_hostname_test || ( echo test chttp2_simple_ssl_fullstack_bad_hostname_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_cancel_after_accept_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test || ( echo test chttp2_simple_ssl_fullstack_cancel_after_accept_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_cancel_after_invoke_test" @@ -1498,8 +1476,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_empty_batch_test || ( echo test chttp2_simple_ssl_fullstack_empty_batch_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_graceful_server_shutdown_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_test || ( echo test chttp2_simple_ssl_fullstack_graceful_server_shutdown_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_invoke_large_request_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test || ( echo test chttp2_simple_ssl_fullstack_invoke_large_request_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_max_concurrent_streams_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_test || ( echo test chttp2_simple_ssl_fullstack_max_concurrent_streams_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_max_message_length_test" @@ -1534,8 +1510,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test" @@ -1556,8 +1530,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_max_message_length_test" @@ -1592,8 +1564,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_bad_hostname_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_bad_hostname_test || ( echo test chttp2_socket_pair_bad_hostname_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_socket_pair_cancel_after_accept_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test || ( echo test chttp2_socket_pair_cancel_after_accept_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_cancel_after_accept_and_writes_closed_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_socket_pair_cancel_after_accept_and_writes_closed_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_cancel_after_invoke_test" @@ -1614,8 +1584,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_empty_batch_test || ( echo test chttp2_socket_pair_empty_batch_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_graceful_server_shutdown_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_test || ( echo test chttp2_socket_pair_graceful_server_shutdown_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_socket_pair_invoke_large_request_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test || ( echo test chttp2_socket_pair_invoke_large_request_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_max_concurrent_streams_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_test || ( echo test chttp2_socket_pair_max_concurrent_streams_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_max_message_length_test" @@ -1650,8 +1618,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test" @@ -1672,8 +1638,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_empty_batch_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_empty_batch_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_max_message_length_test" @@ -1708,8 +1672,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_bad_hostname_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_bad_hostname_test || ( echo test chttp2_socket_pair_with_grpc_trace_bad_hostname_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test || ( echo test chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_test" @@ -1730,8 +1692,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_empty_batch_test || ( echo test chttp2_socket_pair_with_grpc_trace_empty_batch_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test || ( echo test chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_invoke_large_request_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_invoke_large_request_test || ( echo test chttp2_socket_pair_with_grpc_trace_invoke_large_request_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test || ( echo test chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_max_message_length_test" @@ -1788,8 +1748,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_empty_batch_unsecure_test || ( echo test chttp2_fullstack_empty_batch_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_graceful_server_shutdown_unsecure_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_unsecure_test || ( echo test chttp2_fullstack_graceful_server_shutdown_unsecure_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_fullstack_invoke_large_request_unsecure_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_unsecure_test || ( echo test chttp2_fullstack_invoke_large_request_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_max_concurrent_streams_unsecure_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_unsecure_test || ( echo test chttp2_fullstack_max_concurrent_streams_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_max_message_length_unsecure_test" @@ -1844,8 +1802,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_empty_batch_unsecure_test || ( echo test chttp2_fullstack_uds_posix_empty_batch_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_uds_posix_graceful_server_shutdown_unsecure_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_graceful_server_shutdown_unsecure_test || ( echo test chttp2_fullstack_uds_posix_graceful_server_shutdown_unsecure_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test || ( echo test chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_uds_posix_max_concurrent_streams_unsecure_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_max_concurrent_streams_unsecure_test || ( echo test chttp2_fullstack_uds_posix_max_concurrent_streams_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_fullstack_uds_posix_max_message_length_unsecure_test" @@ -1900,8 +1856,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_empty_batch_unsecure_test || ( echo test chttp2_socket_pair_empty_batch_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_graceful_server_shutdown_unsecure_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_unsecure_test || ( echo test chttp2_socket_pair_graceful_server_shutdown_unsecure_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_socket_pair_invoke_large_request_unsecure_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_unsecure_test || ( echo test chttp2_socket_pair_invoke_large_request_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_max_concurrent_streams_unsecure_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_unsecure_test || ( echo test chttp2_socket_pair_max_concurrent_streams_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_max_message_length_unsecure_test" @@ -1956,8 +1910,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_empty_batch_unsecure_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_empty_batch_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_max_message_length_unsecure_test" @@ -2012,8 +1964,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_empty_batch_unsecure_test || ( echo test chttp2_socket_pair_with_grpc_trace_empty_batch_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test || ( echo test chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test failed ; exit 1 ) - $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test" - $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test || ( echo test chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test" $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test || ( echo test chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test failed ; exit 1 ) $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_max_message_length_unsecure_test" @@ -2046,6 +1996,61 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test || ( echo test chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test failed ; exit 1 ) +flaky_test_c: buildtests_c + $(E) "[RUN] Testing census_statistics_multiple_writers_circular_buffer_test" + $(Q) $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_circular_buffer_test || ( echo test census_statistics_multiple_writers_circular_buffer_test failed ; exit 1 ) + $(E) "[RUN] Testing census_statistics_multiple_writers_test" + $(Q) $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_test || ( echo test census_statistics_multiple_writers_test failed ; exit 1 ) + $(E) "[RUN] Testing census_statistics_performance_test" + $(Q) $(BINDIR)/$(CONFIG)/census_statistics_performance_test || ( echo test census_statistics_performance_test failed ; exit 1 ) + $(E) "[RUN] Testing census_statistics_quick_test" + $(Q) $(BINDIR)/$(CONFIG)/census_statistics_quick_test || ( echo test census_statistics_quick_test failed ; exit 1 ) + $(E) "[RUN] Testing census_statistics_small_log_test" + $(Q) $(BINDIR)/$(CONFIG)/census_statistics_small_log_test || ( echo test census_statistics_small_log_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_fake_security_cancel_after_accept_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test || ( echo test chttp2_fake_security_cancel_after_accept_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_fake_security_invoke_large_request_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_test || ( echo test chttp2_fake_security_invoke_large_request_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_fullstack_cancel_after_accept_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test || ( echo test chttp2_fullstack_cancel_after_accept_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_fullstack_invoke_large_request_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_test || ( echo test chttp2_fullstack_invoke_large_request_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_fullstack_uds_posix_cancel_after_accept_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_test || ( echo test chttp2_fullstack_uds_posix_cancel_after_accept_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_fullstack_uds_posix_invoke_large_request_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_invoke_large_request_test || ( echo test chttp2_fullstack_uds_posix_invoke_large_request_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_cancel_after_accept_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test || ( echo test chttp2_simple_ssl_fullstack_cancel_after_accept_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_invoke_large_request_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test || ( echo test chttp2_simple_ssl_fullstack_invoke_large_request_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_socket_pair_cancel_after_accept_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test || ( echo test chttp2_socket_pair_cancel_after_accept_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_socket_pair_invoke_large_request_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test || ( echo test chttp2_socket_pair_invoke_large_request_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test || ( echo test chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_invoke_large_request_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_invoke_large_request_test || ( echo test chttp2_socket_pair_with_grpc_trace_invoke_large_request_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_fullstack_invoke_large_request_unsecure_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_unsecure_test || ( echo test chttp2_fullstack_invoke_large_request_unsecure_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test || ( echo test chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_socket_pair_invoke_large_request_unsecure_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_unsecure_test || ( echo test chttp2_socket_pair_invoke_large_request_unsecure_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test failed ; exit 1 ) + $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test" + $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test || ( echo test chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test failed ; exit 1 ) + + test_cxx: buildtests_cxx $(E) "[RUN] Testing async_end2end_test" $(Q) $(BINDIR)/$(CONFIG)/async_end2end_test || ( echo test async_end2end_test failed ; exit 1 ) @@ -2085,6 +2090,9 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/thread_stress_test || ( echo test thread_stress_test failed ; exit 1 ) +flaky_test_cxx: buildtests_cxx + + test_python: static_c $(E) "[RUN] Testing python code" $(Q) tools/run_tests/run_tests.py -lpython -c$(CONFIG) diff --git a/templates/Makefile.template b/templates/Makefile.template index 2da884e262f..bc8f1bb1d07 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -767,9 +767,20 @@ buildtests_cxx: privatelibs_cxx\ test: test_c test_cxx +flaky_test: flaky_test_c flaky_test_cxx + test_c: buildtests_c % for tgt in targets: -% if tgt.build == 'test' and tgt.get('run', True) and not tgt.language == 'c++': +% if tgt.build == 'test' and tgt.get('run', True) and not tgt.language == 'c++' and not tgt.get('flaky', False): + $(E) "[RUN] Testing ${tgt.name}" + $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) +% endif +% endfor + + +flaky_test_c: buildtests_c +% for tgt in targets: +% if tgt.build == 'test' and tgt.get('run', True) and not tgt.language == 'c++' and tgt.get('flaky', False): $(E) "[RUN] Testing ${tgt.name}" $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) % endif @@ -778,7 +789,16 @@ test_c: buildtests_c test_cxx: buildtests_cxx % for tgt in targets: -% if tgt.build == 'test' and tgt.get('run', True) and tgt.language == 'c++': +% if tgt.build == 'test' and tgt.get('run', True) and tgt.language == 'c++' and not tgt.get('flaky', False): + $(E) "[RUN] Testing ${tgt.name}" + $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) +% endif +% endfor + + +flaky_test_cxx: buildtests_cxx +% for tgt in targets: +% if tgt.build == 'test' and tgt.get('run', True) and tgt.language == 'c++' and tgt.get('flaky', False): $(E) "[RUN] Testing ${tgt.name}" $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) % endif From b4f244f0da5c342f6a62db02bf32bb6c4e695d4d Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 22 May 2015 11:06:11 -0700 Subject: [PATCH 06/27] Reverted change to _write in client.js --- src/node/src/client.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/node/src/client.js b/src/node/src/client.js index 9a50bf24d9c..65339406b2c 100644 --- a/src/node/src/client.js +++ b/src/node/src/client.js @@ -80,7 +80,11 @@ function _write(chunk, encoding, callback) { var batch = {}; batch[grpc.opType.SEND_MESSAGE] = this.serialize(chunk); this.call.startBatch(batch, function(err, event) { - callback(err); + if (err) { + // Something has gone wrong. Stop writing by failing to call callback + return; + } + callback(); }); } From 84f187966f50af37f310fcc05b18c1d5334d5554 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 22 May 2015 13:31:09 -0700 Subject: [PATCH 07/27] Make Python fit within ulimit --- .travis.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9964b6632a0..de40453b067 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,21 +17,21 @@ env: - CPPFLAGS=-I/tmp/prebuilt/include - NUGET="mono nuget.exe" matrix: - - CONFIG=opt TEST=sanity - - CONFIG=gcov TEST=c - - CONFIG=gcov TEST=c++ - - CONFIG=opt TEST="c c++" - - CONFIG=opt TEST=node - - CONFIG=opt TEST=ruby - - CONFIG=opt TEST=python - - CONFIG=opt TEST=csharp - - USE_GCC=4.4 CONFIG=opt TEST=build + - CONFIG=opt TEST=sanity JOBS=1 + - CONFIG=gcov TEST=c JOBS=16 + - CONFIG=gcov TEST=c++ JOBS=16 + - CONFIG=opt TEST="c c++" JOBS=16 + - CONFIG=opt TEST=node JOBS=16 + - CONFIG=opt TEST=ruby JOBS=16 + - CONFIG=opt TEST=python JOBS=1 + - CONFIG=opt TEST=csharp JOBS=16 + - USE_GCC=4.4 CONFIG=opt TEST=build JOBS=16 script: - rvm use $RUBY_VERSION - gem install bundler - ./tools/run_tests/prepare_travis.sh - if [ ! -z "$USE_GCC" ] ; then export CC=gcc-$USE_GCC ; export CXX=g++-$USE_GCC ; fi - - ./tools/run_tests/run_tests.py -l $TEST -t -j 16 -c $CONFIG -s 4.0 + - ./tools/run_tests/run_tests.py -l $TEST -t -j $JOBS -c $CONFIG -s 4.0 after_success: - if [ "$CONFIG" = "gcov" ] ; then coveralls --exclude third_party --exclude gens --exclude test --exclude src/compiler -b. --gcov-options '\-p' ; fi notifications: From e6eebeb355ef7f4613601406fc912c05675dd688 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 22 May 2015 14:09:20 -0700 Subject: [PATCH 08/27] Reduce threadpool size --- src/python/src/grpc/_adapter/fore.py | 2 +- src/python/src/grpc/_adapter/rear.py | 2 +- src/python/src/grpc/framework/base/implementations_test.py | 2 +- src/python/src/grpc/framework/face/_test_case.py | 2 +- .../future_invocation_asynchronous_event_service_test_case.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/python/src/grpc/_adapter/fore.py b/src/python/src/grpc/_adapter/fore.py index 05016cdaf31..69e145e3f61 100644 --- a/src/python/src/grpc/_adapter/fore.py +++ b/src/python/src/grpc/_adapter/fore.py @@ -41,7 +41,7 @@ from grpc.framework.base import null from grpc.framework.foundation import activated from grpc.framework.foundation import logging_pool -_THREAD_POOL_SIZE = 100 +_THREAD_POOL_SIZE = 10 @enum.unique diff --git a/src/python/src/grpc/_adapter/rear.py b/src/python/src/grpc/_adapter/rear.py index dd0a486117f..b3b0b4ed329 100644 --- a/src/python/src/grpc/_adapter/rear.py +++ b/src/python/src/grpc/_adapter/rear.py @@ -41,7 +41,7 @@ from grpc.framework.base import null from grpc.framework.foundation import activated from grpc.framework.foundation import logging_pool -_THREAD_POOL_SIZE = 100 +_THREAD_POOL_SIZE = 10 _INVOCATION_EVENT_KINDS = ( _low.Event.Kind.METADATA_ACCEPTED, diff --git a/src/python/src/grpc/framework/base/implementations_test.py b/src/python/src/grpc/framework/base/implementations_test.py index 11e49caf756..d40bb4d92ee 100644 --- a/src/python/src/grpc/framework/base/implementations_test.py +++ b/src/python/src/grpc/framework/base/implementations_test.py @@ -36,7 +36,7 @@ from grpc.framework.base import interfaces_test_case from grpc.framework.base import util from grpc.framework.foundation import logging_pool -POOL_MAX_WORKERS = 100 +POOL_MAX_WORKERS = 10 DEFAULT_TIMEOUT = 30 MAXIMUM_TIMEOUT = 60 diff --git a/src/python/src/grpc/framework/face/_test_case.py b/src/python/src/grpc/framework/face/_test_case.py index b3a012db001..642d500628d 100644 --- a/src/python/src/grpc/framework/face/_test_case.py +++ b/src/python/src/grpc/framework/face/_test_case.py @@ -35,7 +35,7 @@ from grpc.framework.face.testing import test_case from grpc.framework.foundation import logging_pool _TIMEOUT = 3 -_MAXIMUM_POOL_SIZE = 100 +_MAXIMUM_POOL_SIZE = 10 class FaceTestCase(test_case.FaceTestCase): diff --git a/src/python/src/grpc/framework/face/testing/future_invocation_asynchronous_event_service_test_case.py b/src/python/src/grpc/framework/face/testing/future_invocation_asynchronous_event_service_test_case.py index 0d51b64f1b3..21bf9a42486 100644 --- a/src/python/src/grpc/framework/face/testing/future_invocation_asynchronous_event_service_test_case.py +++ b/src/python/src/grpc/framework/face/testing/future_invocation_asynchronous_event_service_test_case.py @@ -44,7 +44,7 @@ from grpc.framework.foundation import future from grpc.framework.foundation import logging_pool _TIMEOUT = 3 -_MAXIMUM_POOL_SIZE = 100 +_MAXIMUM_POOL_SIZE = 10 class _PauseableIterator(object): From ad7c20c833695f77feb6261723bfb639fbe6fd22 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 22 May 2015 14:42:29 -0700 Subject: [PATCH 09/27] Added tracing for grpc_server_request_call --- src/core/surface/call.h | 13 +++++++++++++ src/core/surface/call_log_batch.c | 16 ++++++++++++++++ src/core/surface/server.c | 3 +++ 3 files changed, 32 insertions(+) diff --git a/src/core/surface/call.h b/src/core/surface/call.h index 60222bf3896..91165389480 100644 --- a/src/core/surface/call.h +++ b/src/core/surface/call.h @@ -122,6 +122,16 @@ void grpc_call_log_batch(char *file, int line, gpr_log_severity severity, grpc_call *call, const grpc_op *ops, size_t nops, void *tag); +void grpc_server_log_request_call(char *file, int line, + gpr_log_severity severity, + grpc_server *server, + grpc_call **call, + grpc_call_details *details, + grpc_metadata_array *initial_metadata, + grpc_completion_queue *cq_bound_to_call, + grpc_completion_queue *cq_for_notification, + void *tag); + /* Set a context pointer. No thread safety guarantees are made wrt this value. */ void grpc_call_context_set(grpc_call *call, grpc_context_index elem, void *value, @@ -132,6 +142,9 @@ void *grpc_call_context_get(grpc_call *call, grpc_context_index elem); #define GRPC_CALL_LOG_BATCH(sev, call, ops, nops, tag) \ if (grpc_trace_batch) grpc_call_log_batch(sev, call, ops, nops, tag) +#define GRPC_SERVER_LOG_REQUEST_CALL(sev, server, call, details, initial_metadata, cq_bound_to_call, cq_for_notifications, tag) \ + if (grpc_trace_batch) grpc_server_log_request_call(sev, server, call, details, initial_metadata, cq_bound_to_call, cq_for_notifications, tag) + gpr_uint8 grpc_call_is_client(grpc_call *call); #endif /* GRPC_INTERNAL_CORE_SURFACE_CALL_H */ diff --git a/src/core/surface/call_log_batch.c b/src/core/surface/call_log_batch.c index e3b3f75b456..9905401bee3 100644 --- a/src/core/surface/call_log_batch.c +++ b/src/core/surface/call_log_batch.c @@ -119,3 +119,19 @@ void grpc_call_log_batch(char *file, int line, gpr_log_severity severity, gpr_free(tmp); } } + +void grpc_server_log_request_call(char *file, int line, + gpr_log_severity severity, + grpc_server *server, + grpc_call **call, + grpc_call_details *details, + grpc_metadata_array *initial_metadata, + grpc_completion_queue *cq_bound_to_call, + grpc_completion_queue *cq_for_notification, + void *tag) { + gpr_log(file, line, severity, + "grpc_server_request_call(server=%p, call=%p, details=%p, " + "initial_metadata=%p, cq_bound_to_call=%p, cq_for_notification=%p, " + "tag=%p)", server, call, details, initial_metadata, + cq_bound_to_call, cq_for_notification, tag); +} diff --git a/src/core/surface/server.c b/src/core/surface/server.c index d75af7291bb..1b2ee867295 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -1010,6 +1010,9 @@ grpc_call_error grpc_server_request_call( grpc_completion_queue *cq_bound_to_call, grpc_completion_queue *cq_for_notification, void *tag) { requested_call rc; + GRPC_SERVER_LOG_REQUEST_CALL(GPR_INFO, server, call, details, + initial_metadata, cq_bound_to_call, + cq_for_notification, tag); grpc_cq_begin_op(cq_for_notification, NULL); rc.type = BATCH_CALL; rc.tag = tag; From e594779a0e42107eb6856a8f20d7fd9066633a0d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 22 May 2015 14:50:03 -0700 Subject: [PATCH 10/27] Reduce threadpool size --- src/python/src/grpc/early_adopter/implementations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/src/grpc/early_adopter/implementations.py b/src/python/src/grpc/early_adopter/implementations.py index f3f2a043ebd..10919fae69f 100644 --- a/src/python/src/grpc/early_adopter/implementations.py +++ b/src/python/src/grpc/early_adopter/implementations.py @@ -41,7 +41,7 @@ from grpc.framework.base import util as _base_utilities from grpc.framework.face import implementations as _face_implementations from grpc.framework.foundation import logging_pool -_THREAD_POOL_SIZE = 80 +_THREAD_POOL_SIZE = 8 _ONE_DAY_IN_SECONDS = 24 * 60 * 60 From 3a5390e90224a78f5aec2a36d695a968ca0387ca Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 22 May 2015 16:14:03 -0700 Subject: [PATCH 11/27] Reduce threadpool size --- src/python/src/grpc/_adapter/_face_test_case.py | 2 +- src/python/src/grpc/_adapter/_links_test.py | 4 ++-- src/python/src/grpc/_adapter/_lonely_rear_link_test.py | 2 +- src/python/src/grpc/framework/face/demonstration.py | 2 +- src/python/src/grpc/framework/face/testing/base_util.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/python/src/grpc/_adapter/_face_test_case.py b/src/python/src/grpc/_adapter/_face_test_case.py index 923e889844d..5fa974ed06c 100644 --- a/src/python/src/grpc/_adapter/_face_test_case.py +++ b/src/python/src/grpc/_adapter/_face_test_case.py @@ -43,7 +43,7 @@ from grpc.framework.foundation import logging_pool _TIMEOUT = 3 _MAXIMUM_TIMEOUT = 90 -_MAXIMUM_POOL_SIZE = 400 +_MAXIMUM_POOL_SIZE = 4 class FaceTestCase(test_case.FaceTestCase, coverage.BlockingCoverage): diff --git a/src/python/src/grpc/_adapter/_links_test.py b/src/python/src/grpc/_adapter/_links_test.py index 4987be389a9..4fd76f60f88 100644 --- a/src/python/src/grpc/_adapter/_links_test.py +++ b/src/python/src/grpc/_adapter/_links_test.py @@ -54,8 +54,8 @@ def _transform_metadata(unused_metadata): class RoundTripTest(unittest.TestCase): def setUp(self): - self.fore_link_pool = logging_pool.pool(80) - self.rear_link_pool = logging_pool.pool(80) + self.fore_link_pool = logging_pool.pool(8) + self.rear_link_pool = logging_pool.pool(8) def tearDown(self): self.rear_link_pool.shutdown(wait=True) diff --git a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py b/src/python/src/grpc/_adapter/_lonely_rear_link_test.py index 25799d679c7..bdb1ee2379e 100644 --- a/src/python/src/grpc/_adapter/_lonely_rear_link_test.py +++ b/src/python/src/grpc/_adapter/_lonely_rear_link_test.py @@ -43,7 +43,7 @@ _TIMEOUT = 2 class LonelyRearLinkTest(unittest.TestCase): def setUp(self): - self.pool = logging_pool.pool(80) + self.pool = logging_pool.pool(8) def tearDown(self): self.pool.shutdown(wait=True) diff --git a/src/python/src/grpc/framework/face/demonstration.py b/src/python/src/grpc/framework/face/demonstration.py index eabeac45697..f6b4b609ffe 100644 --- a/src/python/src/grpc/framework/face/demonstration.py +++ b/src/python/src/grpc/framework/face/demonstration.py @@ -34,7 +34,7 @@ from grpc.framework.base import implementations as _base_implementations from grpc.framework.face import implementations from grpc.framework.foundation import logging_pool -_POOL_SIZE_LIMIT = 20 +_POOL_SIZE_LIMIT = 5 _MAXIMUM_TIMEOUT = 90 diff --git a/src/python/src/grpc/framework/face/testing/base_util.py b/src/python/src/grpc/framework/face/testing/base_util.py index 151d0ef793c..1df1529b27c 100644 --- a/src/python/src/grpc/framework/face/testing/base_util.py +++ b/src/python/src/grpc/framework/face/testing/base_util.py @@ -38,7 +38,7 @@ from grpc.framework.base import in_memory from grpc.framework.base import interfaces # pylint: disable=unused-import from grpc.framework.foundation import logging_pool -_POOL_SIZE_LIMIT = 20 +_POOL_SIZE_LIMIT = 5 _MAXIMUM_TIMEOUT = 90 From 4aba356630d86a06b558945d6a2897c64f627652 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Fri, 22 May 2015 17:25:49 -0700 Subject: [PATCH 12/27] Various tweaks to improve server stability --- src/ruby/.rubocop_todo.yml | 6 +- src/ruby/lib/grpc/generic/rpc_server.rb | 60 +++++++++++-------- src/ruby/spec/generic/rpc_server_pool_spec.rb | 4 +- src/ruby/spec/generic/rpc_server_spec.rb | 42 +++++++++---- 4 files changed, 73 insertions(+), 39 deletions(-) diff --git a/src/ruby/.rubocop_todo.yml b/src/ruby/.rubocop_todo.yml index ed4a4438b3f..c35e970df66 100644 --- a/src/ruby/.rubocop_todo.yml +++ b/src/ruby/.rubocop_todo.yml @@ -1,5 +1,5 @@ # This configuration was generated by `rubocop --auto-gen-config` -# on 2015-04-17 14:43:27 -0700 using RuboCop version 0.30.0. +# on 2015-05-22 13:23:34 -0700 using RuboCop version 0.30.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -7,12 +7,12 @@ # Offense count: 30 Metrics/AbcSize: - Max: 40 + Max: 38 # Offense count: 3 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 184 + Max: 192 # Offense count: 35 # Configuration parameters: CountComments. diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb index 665c1444324..dcb11bfbef7 100644 --- a/src/ruby/lib/grpc/generic/rpc_server.rb +++ b/src/ruby/lib/grpc/generic/rpc_server.rb @@ -76,7 +76,7 @@ module GRPC @jobs = Queue.new @size = size @stopped = false - @stop_mutex = Mutex.new + @stop_mutex = Mutex.new # needs to be held when accessing @stopped @stop_cond = ConditionVariable.new @workers = [] @keep_alive = keep_alive @@ -92,10 +92,15 @@ module GRPC # @param args the args passed blk when it is called # @param blk the block to call def schedule(*args, &blk) - fail 'already stopped' if @stopped return if blk.nil? - GRPC.logger.info('schedule another job') - @jobs << [blk, args] + @stop_mutex.synchronize do + if @stopped + GRPC.logger.warn('did not schedule job, already stopped') + return + end + GRPC.logger.info('schedule another job') + @jobs << [blk, args] + end end # Starts running the jobs in the thread pool. @@ -116,8 +121,8 @@ module GRPC def stop GRPC.logger.info('stopping, will wait for all the workers to exit') @workers.size.times { schedule { throw :exit } } - @stopped = true @stop_mutex.synchronize do # wait @keep_alive for works to stop + @stopped = true @stop_cond.wait(@stop_mutex, @keep_alive) if @workers.size > 0 end forcibly_stop_workers @@ -249,15 +254,18 @@ module GRPC server_override:nil, connect_md_proc:nil, **kw) - @cq = RpcServer.setup_cq(completion_queue_override) - @server = RpcServer.setup_srv(server_override, @cq, **kw) @connect_md_proc = RpcServer.setup_connect_md_proc(connect_md_proc) - @pool_size = pool_size + @cq = RpcServer.setup_cq(completion_queue_override) @max_waiting_requests = max_waiting_requests @poll_period = poll_period - @run_mutex = Mutex.new - @run_cond = ConditionVariable.new + @pool_size = pool_size @pool = Pool.new(@pool_size) + @run_cond = ConditionVariable.new + @run_mutex = Mutex.new + @running = false + @server = RpcServer.setup_srv(server_override, @cq, **kw) + @stopped = false + @stop_mutex = Mutex.new end # stops a running server @@ -266,20 +274,23 @@ module GRPC # server's current call loop is it's last. def stop return unless @running - @stopped = true + @stop_mutex.synchronize do + @stopped = true + end @pool.stop + @server.close + end - # TODO: uncomment this: - # - # This segfaults in the c layer, so its commented out for now. Shutdown - # still occurs, but the c layer has to do the cleanup. - # - # @server.close + # determines if the server has been stopped + def stopped? + @stop_mutex.synchronize do + return @stopped + end end # determines if the server is currently running def running? - @running ||= false + @running end # Is called from other threads to wait for #run to start up the server. @@ -311,11 +322,6 @@ module GRPC t.join end - # Determines if the server is currently stopped - def stopped? - @stopped ||= false - end - # handle registration of classes # # service is either a class that includes GRPC::GenericService and whose @@ -407,7 +413,13 @@ module GRPC request_call_tag = Object.new until stopped? deadline = from_relative_time(@poll_period) - an_rpc = @server.request_call(@cq, request_call_tag, deadline) + begin + an_rpc = @server.request_call(@cq, request_call_tag, deadline) + rescue Core::CallError, RuntimeError => e + # can happen during server shutdown + GRPC.logger.warn("server call failed: #{e}") + next + end c = new_active_server_call(an_rpc) unless c.nil? mth = an_rpc.method.to_sym diff --git a/src/ruby/spec/generic/rpc_server_pool_spec.rb b/src/ruby/spec/generic/rpc_server_pool_spec.rb index aae3a7d7cbf..b67008de486 100644 --- a/src/ruby/spec/generic/rpc_server_pool_spec.rb +++ b/src/ruby/spec/generic/rpc_server_pool_spec.rb @@ -74,11 +74,11 @@ describe GRPC::Pool do end describe '#schedule' do - it 'throws if the pool is already stopped' do + it 'return if the pool is already stopped' do p = Pool.new(1) p.stop job = proc {} - expect { p.schedule(&job) }.to raise_error + expect { p.schedule(&job) }.to_not raise_error end it 'adds jobs that get run by the pool' do diff --git a/src/ruby/spec/generic/rpc_server_spec.rb b/src/ruby/spec/generic/rpc_server_spec.rb index 640b0f656c6..e60a8b27c3f 100644 --- a/src/ruby/spec/generic/rpc_server_spec.rb +++ b/src/ruby/spec/generic/rpc_server_spec.rb @@ -212,10 +212,14 @@ describe GRPC::RpcServer do describe '#stopped?' do before(:each) do - opts = { a_channel_arg: 'an_arg', poll_period: 1 } + opts = { a_channel_arg: 'an_arg', poll_period: 1.5 } @srv = RpcServer.new(**opts) end + after(:each) do + @srv.stop + end + it 'starts out false' do expect(@srv.stopped?).to be(false) end @@ -225,7 +229,7 @@ describe GRPC::RpcServer do expect(@srv.stopped?).to be(false) end - it 'stays false after the server starts running' do + it 'stays false after the server starts running', server: true do @srv.handle(EchoService) t = Thread.new { @srv.run } @srv.wait_till_running @@ -234,7 +238,7 @@ describe GRPC::RpcServer do t.join end - it 'is true after a running server is stopped' do + it 'is true after a running server is stopped', server: true do @srv.handle(EchoService) t = Thread.new { @srv.run } @srv.wait_till_running @@ -251,21 +255,22 @@ describe GRPC::RpcServer do expect(r.running?).to be(false) end - it 'is false after run is called with no services registered' do + it 'is false if run is called with no services registered', server: true do opts = { a_channel_arg: 'an_arg', - poll_period: 1, + poll_period: 2, server_override: @server } r = RpcServer.new(**opts) r.run expect(r.running?).to be(false) + r.stop end it 'is true after run is called with a registered service' do opts = { a_channel_arg: 'an_arg', - poll_period: 1, + poll_period: 2.5, server_override: @server } r = RpcServer.new(**opts) @@ -284,6 +289,10 @@ describe GRPC::RpcServer do @srv = RpcServer.new(**@opts) end + after(:each) do + @srv.stop + end + it 'raises if #run has already been called' do @srv.handle(EchoService) t = Thread.new { @srv.run } @@ -335,6 +344,10 @@ describe GRPC::RpcServer do @srv = RpcServer.new(**server_opts) end + after(:each) do + @srv.stop + end + it 'should return NOT_FOUND status on unknown methods', server: true do @srv.handle(EchoService) t = Thread.new { @srv.run } @@ -376,7 +389,7 @@ describe GRPC::RpcServer do t.join end - it 'should receive metadata when a deadline is specified', server: true do + it 'should receive metadata if a deadline is specified', server: true do service = SlowService.new @srv.handle(service) t = Thread.new { @srv.run } @@ -445,11 +458,11 @@ describe GRPC::RpcServer do it 'should handle multiple parallel requests', server: true do @srv.handle(EchoService) - Thread.new { @srv.run } + t = Thread.new { @srv.run } @srv.wait_till_running req, q = EchoMsg.new, Queue.new n = 5 # arbitrary - threads = [] + threads = [t] n.times do threads << Thread.new do stub = EchoStub.new(@host, **client_opts) @@ -472,7 +485,7 @@ describe GRPC::RpcServer do } alt_srv = RpcServer.new(**opts) alt_srv.handle(SlowService) - Thread.new { alt_srv.run } + t = Thread.new { alt_srv.run } alt_srv.wait_till_running req = EchoMsg.new n = 5 # arbitrary, use as many to ensure the server pool is exceeded @@ -490,6 +503,7 @@ describe GRPC::RpcServer do end threads.each(&:join) alt_srv.stop + t.join expect(one_failed_as_unavailable).to be(true) end end @@ -513,6 +527,10 @@ describe GRPC::RpcServer do @srv = RpcServer.new(**server_opts) end + after(:each) do + @srv.stop + end + it 'should send connect metadata to the client', server: true do service = EchoService.new @srv.handle(service) @@ -545,6 +563,10 @@ describe GRPC::RpcServer do @srv = RpcServer.new(**server_opts) end + after(:each) do + @srv.stop + end + it 'should be added to BadStatus when requests fail', server: true do service = FailingService.new @srv.handle(service) From 234b6e79c027cd1d5a60bed12098dd346ac4c64f Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Sat, 23 May 2015 10:12:40 -0700 Subject: [PATCH 13/27] Add antagonist processes to run_tests.py arsenal These are processes consume CPU for the purpose of slowing down tests, allowing more timing related issues to be exposed. --- tools/run_tests/antagonist.py | 34 ++++++++++++++++++++++++++++++++++ tools/run_tests/run_tests.py | 25 +++++++++++++++++-------- 2 files changed, 51 insertions(+), 8 deletions(-) create mode 100755 tools/run_tests/antagonist.py diff --git a/tools/run_tests/antagonist.py b/tools/run_tests/antagonist.py new file mode 100755 index 00000000000..111839ccf93 --- /dev/null +++ b/tools/run_tests/antagonist.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""This is used by run_tests.py to create cpu load on a machine""" + +while True: + pass diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 1f94238a50c..3a344693c1f 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -40,6 +40,7 @@ import re import sys import time import platform +import subprocess import jobset import watch_dirs @@ -350,6 +351,7 @@ argp.add_argument('-l', '--language', choices=sorted(_LANGUAGES.keys()), nargs='+', default=sorted(_LANGUAGES.keys())) +argp.add_argument('-a', '--antagonists', default=0, type=int) args = argp.parse_args() # grab config @@ -444,14 +446,21 @@ def _build_and_run(check_cancelled, newline_on_success, travis, cache): newline_on_success=newline_on_success, travis=travis): return 1 - # run all the tests - all_runs = itertools.chain.from_iterable( - itertools.repeat(one_run, runs_per_test)) - if not jobset.run(all_runs, check_cancelled, - newline_on_success=newline_on_success, travis=travis, - maxjobs=min(args.jobs, min(c.maxjobs for c in run_configs)), - cache=cache): - return 2 + # start antagonists + antagonists = [subprocess.Popen(['tools/run_tests/antagonist.py']) + for _ in range(0, args.antagonists)] + try: + # run all the tests + all_runs = itertools.chain.from_iterable( + itertools.repeat(one_run, runs_per_test)) + if not jobset.run(all_runs, check_cancelled, + newline_on_success=newline_on_success, travis=travis, + maxjobs=min(args.jobs, min(c.maxjobs for c in run_configs)), + cache=cache): + return 2 + finally: + for antagonist in antagonists: + antagonist.kill() return 0 From 356961916d69bff6cade54bb02b928a956890970 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Sun, 24 May 2015 15:00:37 -0700 Subject: [PATCH 14/27] Remove all uses of __FUNCTION__ --- src/core/httpcli/httpcli.c | 10 ------ src/core/iomgr/sockaddr_utils.c | 6 ++-- src/core/surface/server.c | 2 +- test/core/channel/channel_stack_test.c | 4 --- test/core/end2end/tests/bad_hostname.c | 2 +- test/core/end2end/tests/cancel_after_accept.c | 2 +- .../cancel_after_accept_and_writes_closed.c | 2 +- test/core/end2end/tests/cancel_after_invoke.c | 2 +- .../core/end2end/tests/cancel_before_invoke.c | 2 +- test/core/end2end/tests/cancel_in_a_vacuum.c | 2 +- .../end2end/tests/census_simple_request.c | 2 +- test/core/end2end/tests/disappearing_server.c | 2 +- ..._server_shutdown_finishes_inflight_calls.c | 2 +- .../early_server_shutdown_finishes_tags.c | 2 +- test/core/end2end/tests/empty_batch.c | 2 +- .../end2end/tests/graceful_server_shutdown.c | 2 +- .../core/end2end/tests/invoke_large_request.c | 2 +- .../end2end/tests/max_concurrent_streams.c | 2 +- test/core/end2end/tests/max_message_length.c | 2 +- test/core/end2end/tests/no_op.c | 2 +- test/core/end2end/tests/ping_pong_streaming.c | 2 +- test/core/end2end/tests/registered_call.c | 4 +-- ...esponse_with_binary_metadata_and_payload.c | 2 +- ...quest_response_with_metadata_and_payload.c | 2 +- .../tests/request_response_with_payload.c | 4 +-- ...est_response_with_payload_and_call_creds.c | 8 ++--- ...ponse_with_trailing_metadata_and_payload.c | 2 +- .../tests/request_with_large_metadata.c | 2 +- .../core/end2end/tests/request_with_payload.c | 2 +- .../end2end/tests/server_finishes_request.c | 2 +- .../end2end/tests/simple_delayed_request.c | 4 +-- test/core/end2end/tests/simple_request.c | 4 +-- ...equest_with_high_initial_sequence_number.c | 2 +- test/core/httpcli/httpcli_test.c | 4 +-- test/core/iomgr/endpoint_tests.c | 6 ++-- test/core/iomgr/sockaddr_utils_test.c | 8 ++--- test/core/iomgr/tcp_server_posix_test.c | 10 +++--- test/core/support/cmdline_test.c | 32 +++++++++---------- test/core/support/env_test.c | 4 +-- test/core/support/file_test.c | 10 +++--- test/core/support/histogram_test.c | 8 ++--- test/core/support/slice_test.c | 12 +++---- test/core/support/string_test.c | 10 +++--- test/core/surface/byte_buffer_reader_test.c | 8 ++--- test/core/surface/completion_queue_test.c | 12 +++---- test/core/transport/chttp2/hpack_table_test.c | 8 ++--- test/core/transport/chttp2/stream_map_test.c | 16 +++++----- .../transport/chttp2/timeout_encoding_test.c | 8 ++--- test/core/transport/metadata_test.c | 20 ++++++------ 49 files changed, 127 insertions(+), 143 deletions(-) diff --git a/src/core/httpcli/httpcli.c b/src/core/httpcli/httpcli.c index fe7ea6a86b3..6e4156c385e 100644 --- a/src/core/httpcli/httpcli.c +++ b/src/core/httpcli/httpcli.c @@ -67,7 +67,6 @@ static grpc_httpcli_post_override g_post_override = NULL; static void next_address(internal_request *req); static void finish(internal_request *req, int success) { - gpr_log(GPR_DEBUG, "%s", __FUNCTION__); req->on_response(req->user_data, success ? &req->parser.r : NULL); grpc_httpcli_parser_destroy(&req->parser); if (req->addresses != NULL) { @@ -86,8 +85,6 @@ static void on_read(void *user_data, gpr_slice *slices, size_t nslices, internal_request *req = user_data; size_t i; - gpr_log(GPR_DEBUG, "%s nslices=%d status=%d", __FUNCTION__, nslices, status); - for (i = 0; i < nslices; i++) { if (GPR_SLICE_LENGTH(slices[i])) { req->have_read_byte = 1; @@ -120,13 +117,11 @@ done: } static void on_written(internal_request *req) { - gpr_log(GPR_DEBUG, "%s", __FUNCTION__); grpc_endpoint_notify_on_read(req->ep, on_read, req); } static void done_write(void *arg, grpc_endpoint_cb_status status) { internal_request *req = arg; - gpr_log(GPR_DEBUG, "%s", __FUNCTION__); switch (status) { case GRPC_ENDPOINT_CB_OK: on_written(req); @@ -141,7 +136,6 @@ static void done_write(void *arg, grpc_endpoint_cb_status status) { static void start_write(internal_request *req) { gpr_slice_ref(req->request_text); - gpr_log(GPR_DEBUG, "%s", __FUNCTION__); switch ( grpc_endpoint_write(req->ep, &req->request_text, 1, done_write, req)) { case GRPC_ENDPOINT_WRITE_DONE: @@ -159,7 +153,6 @@ static void on_secure_transport_setup_done(void *rp, grpc_security_status status, grpc_endpoint *secure_endpoint) { internal_request *req = rp; - gpr_log(GPR_DEBUG, "%s", __FUNCTION__); if (status != GRPC_SECURITY_OK) { gpr_log(GPR_ERROR, "Secure transport setup failed with error %d.", status); finish(req, 0); @@ -172,7 +165,6 @@ static void on_secure_transport_setup_done(void *rp, static void on_connected(void *arg, grpc_endpoint *tcp) { internal_request *req = arg; - gpr_log(GPR_DEBUG, "%s", __FUNCTION__); if (!tcp) { next_address(req); return; @@ -200,7 +192,6 @@ static void on_connected(void *arg, grpc_endpoint *tcp) { static void next_address(internal_request *req) { grpc_resolved_address *addr; - gpr_log(GPR_DEBUG, "%s", __FUNCTION__); if (req->next_address == req->addresses->naddrs) { finish(req, 0); return; @@ -212,7 +203,6 @@ static void next_address(internal_request *req) { static void on_resolved(void *arg, grpc_resolved_addresses *addresses) { internal_request *req = arg; - gpr_log(GPR_DEBUG, "%s", __FUNCTION__); if (!addresses) { finish(req, 0); return; diff --git a/src/core/iomgr/sockaddr_utils.c b/src/core/iomgr/sockaddr_utils.c index 740bbe716ec..3d202a5cc8e 100644 --- a/src/core/iomgr/sockaddr_utils.c +++ b/src/core/iomgr/sockaddr_utils.c @@ -169,8 +169,7 @@ int grpc_sockaddr_get_port(const struct sockaddr *addr) { case AF_UNIX: return 1; default: - gpr_log(GPR_ERROR, "Unknown socket family %d in %s", addr->sa_family, - __FUNCTION__); + gpr_log(GPR_ERROR, "Unknown socket family %d in grpc_sockaddr_get_port", addr->sa_family); return 0; } } @@ -184,8 +183,7 @@ int grpc_sockaddr_set_port(const struct sockaddr *addr, int port) { ((struct sockaddr_in6 *)addr)->sin6_port = htons(port); return 1; default: - gpr_log(GPR_ERROR, "Unknown socket family %d in %s", addr->sa_family, - __FUNCTION__); + gpr_log(GPR_ERROR, "Unknown socket family %d in grpc_sockaddr_set_port", addr->sa_family); return 0; } } diff --git a/src/core/surface/server.c b/src/core/surface/server.c index d75af7291bb..24a23ae5c46 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -665,7 +665,7 @@ void *grpc_server_register_method(grpc_server *server, const char *method, const char *host) { registered_method *m; if (!method) { - gpr_log(GPR_ERROR, "%s method string cannot be NULL", __FUNCTION__); + gpr_log(GPR_ERROR, "grpc_server_register_method method string cannot be NULL"); return NULL; } for (m = server->registered_methods; m; m = m->next) { diff --git a/test/core/channel/channel_stack_test.c b/test/core/channel/channel_stack_test.c index 957dee1aa7e..fe92f2f0233 100644 --- a/test/core/channel/channel_stack_test.c +++ b/test/core/channel/channel_stack_test.c @@ -39,8 +39,6 @@ #include #include "test/core/util/test_config.h" -#define LOG_TEST_NAME() gpr_log(GPR_INFO, "%s", __FUNCTION__) - static void channel_init_func(grpc_channel_element *elem, const grpc_channel_args *args, grpc_mdctx *metadata_context, int is_first, @@ -91,8 +89,6 @@ static void test_create_channel_stack(void) { int *channel_data; int *call_data; - LOG_TEST_NAME(); - metadata_context = grpc_mdctx_create(); arg.type = GRPC_ARG_INTEGER; diff --git a/test/core/end2end/tests/bad_hostname.c b/test/core/end2end/tests/bad_hostname.c index e145d2e95be..0220f34534a 100644 --- a/test/core/end2end/tests/bad_hostname.c +++ b/test/core/end2end/tests/bad_hostname.c @@ -158,7 +158,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { static void test_invoke_simple_request(grpc_end2end_test_config config) { grpc_end2end_test_fixture f; - f = begin_test(config, __FUNCTION__, NULL, NULL); + f = begin_test(config, "test_invoke_simple_request", NULL, NULL); simple_request_body(f); end_test(&f); config.tear_down_data(&f); diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c index 275333897fe..daf386c3265 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.c @@ -105,7 +105,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, grpc_op *op; grpc_call *c; grpc_call *s; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "cancel_after_accept", NULL, NULL); gpr_timespec deadline = five_seconds_time(); cq_verifier *v_client = cq_verifier_create(f.client_cq); cq_verifier *v_server = cq_verifier_create(f.server_cq); diff --git a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c b/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c index eaf8b60e98d..0bd98997e96 100644 --- a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c +++ b/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c @@ -105,7 +105,7 @@ static void test_cancel_after_accept_and_writes_closed( grpc_op *op; grpc_call *c; grpc_call *s; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_cancel_after_accept_and_writes_closed", NULL, NULL); gpr_timespec deadline = five_seconds_time(); cq_verifier *v_client = cq_verifier_create(f.client_cq); cq_verifier *v_server = cq_verifier_create(f.server_cq); diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c index 618d9e97e37..c5e0ca55174 100644 --- a/test/core/end2end/tests/cancel_after_invoke.c +++ b/test/core/end2end/tests/cancel_after_invoke.c @@ -106,7 +106,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, grpc_op *op; grpc_call *c; grpc_end2end_test_fixture f = - begin_test(config, __FUNCTION__, mode, NULL, NULL); + begin_test(config, "test_cancel_after_invoke", mode, NULL, NULL); gpr_timespec deadline = five_seconds_time(); cq_verifier *v_client = cq_verifier_create(f.client_cq); grpc_metadata_array initial_metadata_recv; diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c index 9c9d6aadcca..0482d370dcf 100644 --- a/test/core/end2end/tests/cancel_before_invoke.c +++ b/test/core/end2end/tests/cancel_before_invoke.c @@ -103,7 +103,7 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, grpc_op ops[6]; grpc_op *op; grpc_call *c; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "cancel_before_invoke", NULL, NULL); gpr_timespec deadline = five_seconds_time(); cq_verifier *v_client = cq_verifier_create(f.client_cq); grpc_metadata_array initial_metadata_recv; diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.c b/test/core/end2end/tests/cancel_in_a_vacuum.c index 1bc393aba70..f0984cb5dc1 100644 --- a/test/core/end2end/tests/cancel_in_a_vacuum.c +++ b/test/core/end2end/tests/cancel_in_a_vacuum.c @@ -100,7 +100,7 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_cancel_in_a_vacuum(grpc_end2end_test_config config, cancellation_mode mode) { grpc_call *c; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_cancel_in_a_vacuum", NULL, NULL); gpr_timespec deadline = five_seconds_time(); cq_verifier *v_client = cq_verifier_create(f.client_cq); diff --git a/test/core/end2end/tests/census_simple_request.c b/test/core/end2end/tests/census_simple_request.c index 2017ab65365..b808684cd15 100644 --- a/test/core/end2end/tests/census_simple_request.c +++ b/test/core/end2end/tests/census_simple_request.c @@ -204,7 +204,7 @@ static void test_invoke_request_with_census( server_args.num_args = 1; server_args.args = &server_arg; - gpr_asprintf(&fullname, "%s/%s", __FUNCTION__, name); + gpr_asprintf(&fullname, "%s/%s", "test_invoke_request_with_census", name); f = begin_test(config, fullname, &client_args, &server_args); body(f); end_test(&f); diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.c index 89fff81dba0..60e7d227b93 100644 --- a/test/core/end2end/tests/disappearing_server.c +++ b/test/core/end2end/tests/disappearing_server.c @@ -180,7 +180,7 @@ static void disappearing_server_test(grpc_end2end_test_config config) { cq_verifier *v_client = cq_verifier_create(f.client_cq); cq_verifier *v_server = cq_verifier_create(f.server_cq); - gpr_log(GPR_INFO, "%s/%s", __FUNCTION__, config.name); + gpr_log(GPR_INFO, "%s/%s", "disappearing_server_test", config.name); config.init_client(&f, NULL); config.init_server(&f, NULL); diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c index 42280a60460..a44823033d0 100644 --- a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c +++ b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c @@ -102,7 +102,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_call *c; grpc_call *s; gpr_timespec deadline = five_seconds_time(); - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL); cq_verifier *v_client = cq_verifier_create(f.client_cq); cq_verifier *v_server = cq_verifier_create(f.server_cq); grpc_op ops[6]; diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c b/test/core/end2end/tests/early_server_shutdown_finishes_tags.c index 857fbb3c888..a8eb2144bbb 100644 --- a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c +++ b/test/core/end2end/tests/early_server_shutdown_finishes_tags.c @@ -99,7 +99,7 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_early_server_shutdown_finishes_tags( grpc_end2end_test_config config) { - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_early_server_shutdown_finishes_tags", NULL, NULL); cq_verifier *v_server = cq_verifier_create(f.server_cq); grpc_call *s = (void *)1; grpc_call_details call_details; diff --git a/test/core/end2end/tests/empty_batch.c b/test/core/end2end/tests/empty_batch.c index a57f921efbd..d1e5527e9e8 100644 --- a/test/core/end2end/tests/empty_batch.c +++ b/test/core/end2end/tests/empty_batch.c @@ -121,7 +121,7 @@ static void empty_batch_body(grpc_end2end_test_fixture f) { static void test_invoke_empty_body(grpc_end2end_test_config config) { grpc_end2end_test_fixture f; - f = begin_test(config, __FUNCTION__, NULL, NULL); + f = begin_test(config, "test_invoke_empty_body", NULL, NULL); empty_batch_body(f); end_test(&f); config.tear_down_data(&f); diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c index 9c44f6e1277..d7b9fde3a66 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.c +++ b/test/core/end2end/tests/graceful_server_shutdown.c @@ -101,7 +101,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_call *c; grpc_call *s; gpr_timespec deadline = five_seconds_time(); - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL); cq_verifier *v_client = cq_verifier_create(f.client_cq); cq_verifier *v_server = cq_verifier_create(f.server_cq); grpc_op ops[6]; diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c index a5d8faad3af..5552016efa8 100644 --- a/test/core/end2end/tests/invoke_large_request.c +++ b/test/core/end2end/tests/invoke_large_request.c @@ -102,7 +102,7 @@ static gpr_slice large_slice(void) { } static void test_invoke_large_request(grpc_end2end_test_config config) { - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_invoke_large_request", NULL, NULL); gpr_slice request_payload_slice = large_slice(); gpr_slice response_payload_slice = large_slice(); diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c index 59227d98ab2..ef0af34c0d4 100644 --- a/test/core/end2end/tests/max_concurrent_streams.c +++ b/test/core/end2end/tests/max_concurrent_streams.c @@ -222,7 +222,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { server_args.num_args = 1; server_args.args = &server_arg; - f = begin_test(config, __FUNCTION__, NULL, &server_args); + f = begin_test(config, "test_max_concurrent_streams", NULL, &server_args); v_client = cq_verifier_create(f.client_cq); v_server = cq_verifier_create(f.server_cq); diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c index 78502e4bb95..532986e7d08 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.c @@ -126,7 +126,7 @@ static void test_max_message_length(grpc_end2end_test_config config) { server_args.num_args = 1; server_args.args = &server_arg; - f = begin_test(config, __FUNCTION__, NULL, &server_args); + f = begin_test(config, "test_max_message_length", NULL, &server_args); v_client = cq_verifier_create(f.client_cq); v_server = cq_verifier_create(f.server_cq); diff --git a/test/core/end2end/tests/no_op.c b/test/core/end2end/tests/no_op.c index 000d2ffa2ac..5b18efcbfdf 100644 --- a/test/core/end2end/tests/no_op.c +++ b/test/core/end2end/tests/no_op.c @@ -96,7 +96,7 @@ static void end_test(grpc_end2end_test_fixture *f) { } static void test_no_op(grpc_end2end_test_config config) { - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "no-op", NULL, NULL); end_test(&f); config.tear_down_data(&f); } diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c index 2bd17924f30..cfd4e457031 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.c @@ -100,7 +100,7 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Client pings and server pongs. Repeat messages rounds before finishing. */ static void test_pingpong_streaming(grpc_end2end_test_config config, int messages) { - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_pingpong_streaming", NULL, NULL); grpc_call *c; grpc_call *s; gpr_timespec deadline = five_seconds_time(); diff --git a/test/core/end2end/tests/registered_call.c b/test/core/end2end/tests/registered_call.c index 54663c3690b..2cf2ccec1aa 100644 --- a/test/core/end2end/tests/registered_call.c +++ b/test/core/end2end/tests/registered_call.c @@ -188,7 +188,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) { } static void test_invoke_simple_request(grpc_end2end_test_config config) { - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_invoke_simple_request", NULL, NULL); void *rc = grpc_channel_register_call(f.client, "/foo", "foo.test.google.fr:1234"); @@ -199,7 +199,7 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) { static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { int i; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_invoke_10_simple_requests", NULL, NULL); void *rc = grpc_channel_register_call(f.client, "/foo", "foo.test.google.fr:1234"); diff --git a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c index 868b5f078b0..69eb68a2a1c 100644 --- a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c +++ b/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c @@ -127,7 +127,7 @@ static void test_request_response_with_metadata_and_payload( "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", 16, {{NULL, NULL, NULL}}}}; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_request_response_with_metadata_and_payload", NULL, NULL); cq_verifier *v_client = cq_verifier_create(f.client_cq); cq_verifier *v_server = cq_verifier_create(f.server_cq); grpc_op ops[6]; diff --git a/test/core/end2end/tests/request_response_with_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_metadata_and_payload.c index 9c5d2902199..fe15fa257d7 100644 --- a/test/core/end2end/tests/request_response_with_metadata_and_payload.c +++ b/test/core/end2end/tests/request_response_with_metadata_and_payload.c @@ -113,7 +113,7 @@ static void test_request_response_with_metadata_and_payload( {"key2", "val2", 4, {{NULL, NULL, NULL}}}}; grpc_metadata meta_s[2] = {{"key3", "val3", 4, {{NULL, NULL, NULL}}}, {"key4", "val4", 4, {{NULL, NULL, NULL}}}}; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_request_response_with_metadata_and_payload", NULL, NULL); cq_verifier *v_client = cq_verifier_create(f.client_cq); cq_verifier *v_server = cq_verifier_create(f.server_cq); grpc_op ops[6]; diff --git a/test/core/end2end/tests/request_response_with_payload.c b/test/core/end2end/tests/request_response_with_payload.c index 7db202754e7..f0122ea95dd 100644 --- a/test/core/end2end/tests/request_response_with_payload.c +++ b/test/core/end2end/tests/request_response_with_payload.c @@ -223,7 +223,7 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) { payload and status. */ static void test_invoke_request_response_with_payload( grpc_end2end_test_config config) { - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_invoke_request_response_with_payload", NULL, NULL); request_response_with_payload(f); end_test(&f); config.tear_down_data(&f); @@ -232,7 +232,7 @@ static void test_invoke_request_response_with_payload( static void test_invoke_10_request_response_with_payload( grpc_end2end_test_config config) { int i; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_invoke_10_request_response_with_payload", NULL, NULL); for (i = 0; i < 10; i++) { request_response_with_payload(f); } diff --git a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c b/test/core/end2end/tests/request_response_with_payload_and_call_creds.c index 437345960ac..df1e9d76717 100644 --- a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c +++ b/test/core/end2end/tests/request_response_with_payload_and_call_creds.c @@ -114,7 +114,7 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_call_creds_failure(grpc_end2end_test_config config) { grpc_call *c; grpc_credentials *creds = NULL; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_call_creds_failure", NULL, NULL); gpr_timespec deadline = five_seconds_time(); c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "foo.test.google.fr", deadline); @@ -318,17 +318,17 @@ static void request_response_with_payload_and_call_creds( void test_request_response_with_payload_and_call_creds( grpc_end2end_test_config config) { - request_response_with_payload_and_call_creds(__FUNCTION__, config, NONE); + request_response_with_payload_and_call_creds("test_request_response_with_payload_and_call_creds", config, NONE); } void test_request_response_with_payload_and_overridden_call_creds( grpc_end2end_test_config config) { - request_response_with_payload_and_call_creds(__FUNCTION__, config, OVERRIDE); + request_response_with_payload_and_call_creds("test_request_response_with_payload_and_overridden_call_creds", config, OVERRIDE); } void test_request_response_with_payload_and_deleted_call_creds( grpc_end2end_test_config config) { - request_response_with_payload_and_call_creds(__FUNCTION__, config, DESTROY); + request_response_with_payload_and_call_creds("test_request_response_with_payload_and_deleted_call_creds", config, DESTROY); } void grpc_end2end_tests(grpc_end2end_test_config config) { diff --git a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c index 2f7b53ccf33..2f221f43d50 100644 --- a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c +++ b/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c @@ -112,7 +112,7 @@ static void test_request_response_with_metadata_and_payload( grpc_metadata meta_c[2] = {{"key1", "val1", 4, {{NULL, NULL, NULL}}}, {"key2", "val2", 4, {{NULL, NULL, NULL}}}}; grpc_metadata meta_s[2] = {{"key3", "val3", 4, {{NULL, NULL, NULL}}}, {"key4", "val4", 4, {{NULL, NULL, NULL}}}}; grpc_metadata meta_t[2] = {{"key5", "val5", 4, {{NULL, NULL, NULL}}}, {"key6", "val6", 4, {{NULL, NULL, NULL}}}}; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_request_response_with_metadata_and_payload", NULL, NULL); cq_verifier *v_client = cq_verifier_create(f.client_cq); cq_verifier *v_server = cq_verifier_create(f.server_cq); grpc_op ops[6]; diff --git a/test/core/end2end/tests/request_with_large_metadata.c b/test/core/end2end/tests/request_with_large_metadata.c index 81a15725012..b89ccb76f02 100644 --- a/test/core/end2end/tests/request_with_large_metadata.c +++ b/test/core/end2end/tests/request_with_large_metadata.c @@ -106,7 +106,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { grpc_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); grpc_metadata meta; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_request_with_large_metadata", NULL, NULL); cq_verifier *v_client = cq_verifier_create(f.client_cq); cq_verifier *v_server = cq_verifier_create(f.server_cq); grpc_op ops[6]; diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c index 0d527b4de5c..9f6f2a9b227 100644 --- a/test/core/end2end/tests/request_with_payload.c +++ b/test/core/end2end/tests/request_with_payload.c @@ -105,7 +105,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { grpc_byte_buffer *request_payload = grpc_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_invoke_request_with_payload", NULL, NULL); cq_verifier *v_client = cq_verifier_create(f.client_cq); cq_verifier *v_server = cq_verifier_create(f.server_cq); grpc_op ops[6]; diff --git a/test/core/end2end/tests/server_finishes_request.c b/test/core/end2end/tests/server_finishes_request.c index c19871c581d..a0c18652906 100644 --- a/test/core/end2end/tests/server_finishes_request.c +++ b/test/core/end2end/tests/server_finishes_request.c @@ -189,7 +189,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { static void test_invoke_simple_request(grpc_end2end_test_config config) { grpc_end2end_test_fixture f; - f = begin_test(config, __FUNCTION__, NULL, NULL); + f = begin_test(config, "test_invoke_simple_request", NULL, NULL); simple_request_body(f); end_test(&f); config.tear_down_data(&f); diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c index d8463d4c6c4..59cc9b54884 100644 --- a/test/core/end2end/tests/simple_delayed_request.c +++ b/test/core/end2end/tests/simple_delayed_request.c @@ -185,7 +185,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, static void test_simple_delayed_request_short(grpc_end2end_test_config config) { grpc_end2end_test_fixture f; - gpr_log(GPR_INFO, "%s/%s", __FUNCTION__, config.name); + gpr_log(GPR_INFO, "%s/%s", "test_simple_delayed_request_short", config.name); f = config.create_fixture(NULL, NULL); simple_delayed_request_body(config, &f, NULL, NULL, 100000); end_test(&f); @@ -195,7 +195,7 @@ static void test_simple_delayed_request_short(grpc_end2end_test_config config) { static void test_simple_delayed_request_long(grpc_end2end_test_config config) { grpc_end2end_test_fixture f; - gpr_log(GPR_INFO, "%s/%s", __FUNCTION__, config.name); + gpr_log(GPR_INFO, "%s/%s", "test_simple_delayed_request_long", config.name); f = config.create_fixture(NULL, NULL); /* This timeout should be longer than a single retry */ simple_delayed_request_body(config, &f, NULL, NULL, 1500000); diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.c index 98e677900eb..80c092cd358 100644 --- a/test/core/end2end/tests/simple_request.c +++ b/test/core/end2end/tests/simple_request.c @@ -191,7 +191,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { static void test_invoke_simple_request(grpc_end2end_test_config config) { grpc_end2end_test_fixture f; - f = begin_test(config, __FUNCTION__, NULL, NULL); + f = begin_test(config, "test_invoke_simple_request", NULL, NULL); simple_request_body(f); end_test(&f); config.tear_down_data(&f); @@ -199,7 +199,7 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) { static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { int i; - grpc_end2end_test_fixture f = begin_test(config, __FUNCTION__, NULL, NULL); + grpc_end2end_test_fixture f = begin_test(config, "test_invoke_10_simple_requests", NULL, NULL); for (i = 0; i < 10; i++) { simple_request_body(f); gpr_log(GPR_INFO, "Passed simple request %d", i); diff --git a/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c b/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c index 3c1a19a5dd4..67e0730f5e2 100644 --- a/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c +++ b/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c @@ -201,7 +201,7 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config, int client_args.num_args = 1; client_args.args = &client_arg; - f = begin_test(config, __FUNCTION__, &client_args, NULL); + f = begin_test(config, "test_invoke_10_simple_requests", &client_args, NULL); for (i = 0; i < 10; i++) { simple_request_body(f); gpr_log(GPR_INFO, "Passed simple request %d", i); diff --git a/test/core/httpcli/httpcli_test.c b/test/core/httpcli/httpcli_test.c index 17a2996baab..fb2dbc00ce8 100644 --- a/test/core/httpcli/httpcli_test.c +++ b/test/core/httpcli/httpcli_test.c @@ -56,7 +56,7 @@ static void on_finish(void *arg, const grpc_httpcli_response *response) { static void test_get(int use_ssl) { grpc_httpcli_request req; - gpr_log(GPR_INFO, "running %s with use_ssl=%d.", __FUNCTION__, use_ssl); + gpr_log(GPR_INFO, "running %s with use_ssl=%d.", "test_get", use_ssl); gpr_event_init(&g_done); memset(&req, 0, sizeof(req)); @@ -72,7 +72,7 @@ static void test_get(int use_ssl) { static void test_post(int use_ssl) { grpc_httpcli_request req; - gpr_log(GPR_INFO, "running %s with use_ssl=%d.", __FUNCTION__, (int)use_ssl); + gpr_log(GPR_INFO, "running %s with use_ssl=%d.", "test_post", (int)use_ssl); gpr_event_init(&g_done); memset(&req, 0, sizeof(req)); diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c index e63048e26c8..f9c5282f19c 100644 --- a/test/core/iomgr/endpoint_tests.c +++ b/test/core/iomgr/endpoint_tests.c @@ -160,7 +160,7 @@ static void read_and_write_test_write_handler(void *data, GPR_ASSERT(error != GRPC_ENDPOINT_CB_ERROR); - gpr_log(GPR_DEBUG, "%s: error=%d", __FUNCTION__, error); + gpr_log(GPR_DEBUG, "%s: error=%d", "read_and_write_test_write_handler", error); if (error == GRPC_ENDPOINT_CB_SHUTDOWN) { gpr_log(GPR_INFO, "Write handler shutdown"); @@ -213,7 +213,7 @@ static void read_and_write_test(grpc_endpoint_test_config config, size_t slice_size, int shutdown) { struct read_and_write_test_state state; gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); - grpc_endpoint_test_fixture f = begin_test(config, __FUNCTION__, slice_size); + grpc_endpoint_test_fixture f = begin_test(config, "read_and_write_test", slice_size); if (shutdown) { gpr_log(GPR_INFO, "Start read and write shutdown test"); @@ -323,7 +323,7 @@ static void shutdown_during_write_test(grpc_endpoint_test_config config, shutdown_during_write_test_state read_st; shutdown_during_write_test_state write_st; gpr_slice *slices; - grpc_endpoint_test_fixture f = begin_test(config, __FUNCTION__, slice_size); + grpc_endpoint_test_fixture f = begin_test(config, "shutdown_during_write_test", slice_size); gpr_log(GPR_INFO, "testing shutdown during a write"); diff --git a/test/core/iomgr/sockaddr_utils_test.c b/test/core/iomgr/sockaddr_utils_test.c index 9212f01c3fc..dfab3409597 100644 --- a/test/core/iomgr/sockaddr_utils_test.c +++ b/test/core/iomgr/sockaddr_utils_test.c @@ -75,7 +75,7 @@ static void test_sockaddr_is_v4mapped(void) { struct sockaddr_in output4; struct sockaddr_in expect4; - gpr_log(GPR_INFO, "%s", __FUNCTION__); + gpr_log(GPR_INFO, "%s", "test_sockaddr_is_v4mapped"); /* v4mapped input should succeed. */ input6 = make_addr6(kMapped, sizeof(kMapped)); @@ -106,7 +106,7 @@ static void test_sockaddr_to_v4mapped(void) { struct sockaddr_in6 output6; struct sockaddr_in6 expect6; - gpr_log(GPR_INFO, "%s", __FUNCTION__); + gpr_log(GPR_INFO, "%s", "test_sockaddr_to_v4mapped"); /* IPv4 input should succeed. */ input4 = make_addr4(kIPv4, sizeof(kIPv4)); @@ -135,7 +135,7 @@ static void test_sockaddr_is_wildcard(void) { struct sockaddr dummy; int port; - gpr_log(GPR_INFO, "%s", __FUNCTION__); + gpr_log(GPR_INFO, "%s", "test_sockaddr_is_wildcard"); /* Generate wildcards. */ grpc_sockaddr_make_wildcards(555, &wild4, &wild6); @@ -192,7 +192,7 @@ static void test_sockaddr_to_string(void) { struct sockaddr_in6 input6; struct sockaddr dummy; - gpr_log(GPR_INFO, "%s", __FUNCTION__); + gpr_log(GPR_INFO, "%s", "test_sockaddr_to_string"); errno = 0x7EADBEEF; diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c index 1c02c4b2f80..328b19f68a9 100644 --- a/test/core/iomgr/tcp_server_posix_test.c +++ b/test/core/iomgr/tcp_server_posix_test.c @@ -43,7 +43,7 @@ #include #include -#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) +#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x) static gpr_mu mu; static gpr_cv cv; @@ -66,7 +66,7 @@ static void test_no_op(void) { static void test_no_op_with_start(void) { grpc_tcp_server *s = grpc_tcp_server_create(); - LOG_TEST(); + LOG_TEST("test_no_op_with_start"); grpc_tcp_server_start(s, NULL, 0, on_connect, NULL); grpc_tcp_server_destroy(s, NULL, NULL); } @@ -74,7 +74,7 @@ static void test_no_op_with_start(void) { static void test_no_op_with_port(void) { struct sockaddr_in addr; grpc_tcp_server *s = grpc_tcp_server_create(); - LOG_TEST(); + LOG_TEST("test_no_op_with_port"); memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; @@ -87,7 +87,7 @@ static void test_no_op_with_port(void) { static void test_no_op_with_port_and_start(void) { struct sockaddr_in addr; grpc_tcp_server *s = grpc_tcp_server_create(); - LOG_TEST(); + LOG_TEST("test_no_op_with_port_and_start"); memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; @@ -107,7 +107,7 @@ static void test_connect(int n) { int nconnects_before; gpr_timespec deadline; int i; - LOG_TEST(); + LOG_TEST("test_connect"); gpr_log(GPR_INFO, "clients=%d", n); gpr_mu_lock(&mu); diff --git a/test/core/support/cmdline_test.c b/test/core/support/cmdline_test.c index 52c311f75c2..a7767ace5e8 100644 --- a/test/core/support/cmdline_test.c +++ b/test/core/support/cmdline_test.c @@ -39,12 +39,12 @@ #include #include "test/core/util/test_config.h" -#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) +#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FILE__) static void test_simple_int(void) { int x = 1; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "-foo", "3"}; + char *args[] = {(char *)__FILE__, "-foo", "3"}; LOG_TEST(); @@ -59,7 +59,7 @@ static void test_simple_int(void) { static void test_eq_int(void) { int x = 1; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "-foo=3"}; + char *args[] = {(char *)__FILE__, "-foo=3"}; LOG_TEST(); @@ -74,7 +74,7 @@ static void test_eq_int(void) { static void test_2dash_int(void) { int x = 1; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "--foo", "3"}; + char *args[] = {(char *)__FILE__, "--foo", "3"}; LOG_TEST(); @@ -89,7 +89,7 @@ static void test_2dash_int(void) { static void test_2dash_eq_int(void) { int x = 1; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "--foo=3"}; + char *args[] = {(char *)__FILE__, "--foo=3"}; LOG_TEST(); @@ -104,7 +104,7 @@ static void test_2dash_eq_int(void) { static void test_simple_string(void) { char *x = NULL; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "-foo", "3"}; + char *args[] = {(char *)__FILE__, "-foo", "3"}; LOG_TEST(); @@ -119,7 +119,7 @@ static void test_simple_string(void) { static void test_eq_string(void) { char *x = NULL; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "-foo=3"}; + char *args[] = {(char *)__FILE__, "-foo=3"}; LOG_TEST(); @@ -134,7 +134,7 @@ static void test_eq_string(void) { static void test_2dash_string(void) { char *x = NULL; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "--foo", "3"}; + char *args[] = {(char *)__FILE__, "--foo", "3"}; LOG_TEST(); @@ -149,7 +149,7 @@ static void test_2dash_string(void) { static void test_2dash_eq_string(void) { char *x = NULL; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "--foo=3"}; + char *args[] = {(char *)__FILE__, "--foo=3"}; LOG_TEST(); @@ -164,7 +164,7 @@ static void test_2dash_eq_string(void) { static void test_flag_on(void) { int x = 2; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "--foo"}; + char *args[] = {(char *)__FILE__, "--foo"}; LOG_TEST(); @@ -179,7 +179,7 @@ static void test_flag_on(void) { static void test_flag_no(void) { int x = 2; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "--no-foo"}; + char *args[] = {(char *)__FILE__, "--no-foo"}; LOG_TEST(); @@ -194,7 +194,7 @@ static void test_flag_no(void) { static void test_flag_val_1(void) { int x = 2; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "--foo=1"}; + char *args[] = {(char *)__FILE__, "--foo=1"}; LOG_TEST(); @@ -209,7 +209,7 @@ static void test_flag_val_1(void) { static void test_flag_val_0(void) { int x = 2; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "--foo=0"}; + char *args[] = {(char *)__FILE__, "--foo=0"}; LOG_TEST(); @@ -224,7 +224,7 @@ static void test_flag_val_0(void) { static void test_flag_val_true(void) { int x = 2; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "--foo=true"}; + char *args[] = {(char *)__FILE__, "--foo=true"}; LOG_TEST(); @@ -239,7 +239,7 @@ static void test_flag_val_true(void) { static void test_flag_val_false(void) { int x = 2; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "--foo=false"}; + char *args[] = {(char *)__FILE__, "--foo=false"}; LOG_TEST(); @@ -257,7 +257,7 @@ static void test_many(void) { int flag = 2; gpr_cmdline *cl; - char *args[] = {(char *)__FUNCTION__, "--str", "hello", "-x=4", "-no-flag"}; + char *args[] = {(char *)__FILE__, "--str", "hello", "-x=4", "-no-flag"}; LOG_TEST(); diff --git a/test/core/support/env_test.c b/test/core/support/env_test.c index aedf9313f32..69aebcc918c 100644 --- a/test/core/support/env_test.c +++ b/test/core/support/env_test.c @@ -41,14 +41,14 @@ #include "src/core/support/string.h" #include "test/core/util/test_config.h" -#define LOG_TEST_NAME() gpr_log(GPR_INFO, "%s", __FUNCTION__) +#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x) static void test_setenv_getenv(void) { const char *name = "FOO"; const char *value = "BAR"; char *retrieved_value; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_setenv_getenv"); gpr_setenv(name, value); retrieved_value = gpr_getenv(name); diff --git a/test/core/support/file_test.c b/test/core/support/file_test.c index 56e7a4948e7..330b2173ef9 100644 --- a/test/core/support/file_test.c +++ b/test/core/support/file_test.c @@ -42,7 +42,7 @@ #include "src/core/support/string.h" #include "test/core/util/test_config.h" -#define LOG_TEST_NAME() gpr_log(GPR_INFO, "%s", __FUNCTION__) +#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x) static const char prefix[] = "file_test"; @@ -53,7 +53,7 @@ static void test_load_empty_file(void) { int success; char *tmp_name; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_load_empty_file"); tmp = gpr_tmpfile(prefix, &tmp_name); GPR_ASSERT(tmp_name != NULL); @@ -81,7 +81,7 @@ static void test_load_failure(void) { int success; char *tmp_name; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_load_failure"); tmp = gpr_tmpfile(prefix, &tmp_name); GPR_ASSERT(tmp_name != NULL); @@ -104,7 +104,7 @@ static void test_load_small_file(void) { char *tmp_name; const char *blah = "blah"; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_load_small_file"); tmp = gpr_tmpfile(prefix, &tmp_name); GPR_ASSERT(tmp_name != NULL); @@ -138,7 +138,7 @@ static void test_load_big_file(void) { unsigned char *current; size_t i; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_load_big_file"); for (i = 0; i < sizeof(buffer); i++) { buffer[i] = 42; diff --git a/test/core/support/histogram_test.c b/test/core/support/histogram_test.c index 39944308743..be935ede093 100644 --- a/test/core/support/histogram_test.c +++ b/test/core/support/histogram_test.c @@ -34,7 +34,7 @@ #include #include -#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__); +#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x); static void test_no_op(void) { gpr_histogram_destroy(gpr_histogram_create(0.01, 60e9)); @@ -52,7 +52,7 @@ static void expect_percentile(gpr_histogram *h, double percentile, static void test_simple(void) { gpr_histogram *h; - LOG_TEST(); + LOG_TEST("test_simple"); h = gpr_histogram_create(0.01, 60e9); gpr_histogram_add(h, 10000); @@ -72,7 +72,7 @@ static void test_percentile(void) { double i; double cur; - LOG_TEST(); + LOG_TEST("test_percentile"); h = gpr_histogram_create(0.05, 1e9); gpr_histogram_add(h, 2.5); @@ -117,7 +117,7 @@ static void test_merge(void) { double i; double cur; - LOG_TEST(); + LOG_TEST("test_merge"); h1 = gpr_histogram_create(0.05, 1e9); gpr_histogram_add(h1, 2.5); diff --git a/test/core/support/slice_test.c b/test/core/support/slice_test.c index 4ab3d6f45b9..63dedea50fe 100644 --- a/test/core/support/slice_test.c +++ b/test/core/support/slice_test.c @@ -38,7 +38,7 @@ #include #include "test/core/util/test_config.h" -#define LOG_TEST_NAME() gpr_log(GPR_INFO, "%s", __FUNCTION__); +#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x); static void test_slice_malloc_returns_something_sensible(void) { /* Calls gpr_slice_create for various lengths and verifies the internals for @@ -47,7 +47,7 @@ static void test_slice_malloc_returns_something_sensible(void) { size_t i; gpr_slice slice; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_slice_malloc_returns_something_sensible"); for (length = 0; length <= 1024; length++) { slice = gpr_slice_malloc(length); @@ -108,7 +108,7 @@ static void test_slice_sub_works(unsigned length) { gpr_slice sub; unsigned i, j, k; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_slice_sub_works"); gpr_log(GPR_INFO, "length=%d", length); /* Create a slice in which each byte is equal to the distance from it to the @@ -147,7 +147,7 @@ static void test_slice_split_head_works(int length) { gpr_slice head, tail; int i; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_slice_split_head_works"); gpr_log(GPR_INFO, "length=%d", length); /* Create a slice in which each byte is equal to the distance from it to the @@ -175,7 +175,7 @@ static void test_slice_split_tail_works(int length) { gpr_slice head, tail; int i; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_slice_split_tail_works"); gpr_log(GPR_INFO, "length=%d", length); /* Create a slice in which each byte is equal to the distance from it to the @@ -202,7 +202,7 @@ static void test_slice_from_copied_string_works(void) { static const char *text = "HELLO WORLD!"; gpr_slice slice; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_slice_from_copied_string_works"); slice = gpr_slice_from_copied_string(text); GPR_ASSERT(strlen(text) == GPR_SLICE_LENGTH(slice)); diff --git a/test/core/support/string_test.c b/test/core/support/string_test.c index a78e4782a29..a1692ab39f0 100644 --- a/test/core/support/string_test.c +++ b/test/core/support/string_test.c @@ -42,13 +42,13 @@ #include #include "test/core/util/test_config.h" -#define LOG_TEST_NAME() gpr_log(GPR_INFO, "%s", __FUNCTION__) +#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x) static void test_strdup(void) { static const char *src1 = "hello world"; char *dst1; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_strdup"); dst1 = gpr_strdup(src1); GPR_ASSERT(0 == strcmp(src1, dst1)); @@ -65,7 +65,7 @@ static void expect_hexdump(const char *buf, size_t len, gpr_uint32 flags, } static void test_hexdump(void) { - LOG_TEST_NAME(); + LOG_TEST_NAME("test_hexdump"); expect_hexdump("\x01", 1, 0, "01"); expect_hexdump("\x01", 1, GPR_HEXDUMP_PLAINTEXT, "01 '.'"); expect_hexdump("\x01\x02", 2, 0, "01 02"); @@ -86,7 +86,7 @@ static void test_pu32_succeed(const char *s, gpr_uint32 want) { } static void test_parse_uint32(void) { - LOG_TEST_NAME(); + LOG_TEST_NAME("test_parse_uint32"); test_pu32_fail("-1"); test_pu32_fail("a"); @@ -123,7 +123,7 @@ static void test_asprintf(void) { char *buf; int i, j; - LOG_TEST_NAME(); + LOG_TEST_NAME("test_asprintf"); /* Print an empty string. */ GPR_ASSERT(gpr_asprintf(&buf, "") == 0); diff --git a/test/core/surface/byte_buffer_reader_test.c b/test/core/surface/byte_buffer_reader_test.c index b121abf7572..9265ef16b01 100644 --- a/test/core/surface/byte_buffer_reader_test.c +++ b/test/core/surface/byte_buffer_reader_test.c @@ -44,13 +44,13 @@ #include -#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) +#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x) static void test_create(void) { grpc_byte_buffer *buffer; grpc_byte_buffer_reader *reader; gpr_slice empty = gpr_empty_slice(); - LOG_TEST(); + LOG_TEST("test_create"); buffer = grpc_byte_buffer_create(&empty, 1); reader = grpc_byte_buffer_reader_create(buffer); grpc_byte_buffer_reader_destroy(reader); @@ -64,7 +64,7 @@ static void test_read_one_slice(void) { gpr_slice first_slice, second_slice; int first_code, second_code; - LOG_TEST(); + LOG_TEST("test_read_one_slice"); slice = gpr_slice_from_copied_string("test"); buffer = grpc_byte_buffer_create(&slice, 1); gpr_slice_unref(slice); @@ -86,7 +86,7 @@ static void test_read_one_slice_malloc(void) { gpr_slice first_slice, second_slice; int first_code, second_code; - LOG_TEST(); + LOG_TEST("test_read_one_slice_malloc"); slice = gpr_slice_malloc(4); memcpy(GPR_SLICE_START_PTR(slice), "test", 4); buffer = grpc_byte_buffer_create(&slice, 1); diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index 3e84eaf54c9..e26f379bfc3 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -41,7 +41,7 @@ #include #include "test/core/util/test_config.h" -#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) +#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x) static void *create_test_tag(void) { static gpr_intptr i = 0; @@ -59,14 +59,14 @@ static void shutdown_and_destroy(grpc_completion_queue *cc) { /* ensure we can create and destroy a completion channel */ static void test_no_op(void) { - LOG_TEST(); + LOG_TEST("test_no_op"); shutdown_and_destroy(grpc_completion_queue_create()); } static void test_wait_empty(void) { grpc_completion_queue *cc; - LOG_TEST(); + LOG_TEST("test_wait_empty"); cc = grpc_completion_queue_create(); GPR_ASSERT(grpc_completion_queue_next(cc, gpr_now()).type == @@ -79,7 +79,7 @@ static void test_cq_end_op(void) { grpc_completion_queue *cc; void *tag = create_test_tag(); - LOG_TEST(); + LOG_TEST("test_cq_end_op"); cc = grpc_completion_queue_create(); @@ -100,7 +100,7 @@ static void test_pluck(void) { void *tags[128]; unsigned i, j; - LOG_TEST(); + LOG_TEST("test_pluck"); for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { tags[i] = create_test_tag(); @@ -222,7 +222,7 @@ static void test_threading(int producers, int consumers) { int total_consumed = 0; static int optid = 101; - gpr_log(GPR_INFO, "%s: %d producers, %d consumers", __FUNCTION__, producers, + gpr_log(GPR_INFO, "%s: %d producers, %d consumers", "test_threading", producers, consumers); grpc_completion_queue_dont_poll_test_only(cc); diff --git a/test/core/transport/chttp2/hpack_table_test.c b/test/core/transport/chttp2/hpack_table_test.c index d1e5f0829a8..6bc697878af 100644 --- a/test/core/transport/chttp2/hpack_table_test.c +++ b/test/core/transport/chttp2/hpack_table_test.c @@ -41,7 +41,7 @@ #include #include "test/core/util/test_config.h" -#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) +#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x) static void assert_str(const grpc_chttp2_hptbl *tbl, grpc_mdstr *mdstr, const char *str) { @@ -62,7 +62,7 @@ static void test_static_lookup(void) { mdctx = grpc_mdctx_create(); grpc_chttp2_hptbl_init(&tbl, mdctx); - LOG_TEST(); + LOG_TEST("test_static_lookup"); assert_index(&tbl, 1, ":authority", ""); assert_index(&tbl, 2, ":method", "GET"); assert_index(&tbl, 3, ":method", "POST"); @@ -136,7 +136,7 @@ static void test_many_additions(void) { char *value; grpc_mdctx *mdctx; - LOG_TEST(); + LOG_TEST("test_many_additions"); mdctx = grpc_mdctx_create(); grpc_chttp2_hptbl_init(&tbl, mdctx); @@ -177,7 +177,7 @@ static void test_find(void) { grpc_mdctx *mdctx; grpc_chttp2_hptbl_find_result r; - LOG_TEST(); + LOG_TEST("test_find"); mdctx = grpc_mdctx_create(); grpc_chttp2_hptbl_init(&tbl, mdctx); diff --git a/test/core/transport/chttp2/stream_map_test.c b/test/core/transport/chttp2/stream_map_test.c index d678e0af73f..3c6976ee9dd 100644 --- a/test/core/transport/chttp2/stream_map_test.c +++ b/test/core/transport/chttp2/stream_map_test.c @@ -35,13 +35,13 @@ #include #include "test/core/util/test_config.h" -#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) +#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x) /* test creation & destruction */ static void test_no_op(void) { grpc_chttp2_stream_map map; - LOG_TEST(); + LOG_TEST("test_no_op"); grpc_chttp2_stream_map_init(&map, 8); grpc_chttp2_stream_map_destroy(&map); @@ -51,7 +51,7 @@ static void test_no_op(void) { static void test_empty_find(void) { grpc_chttp2_stream_map map; - LOG_TEST(); + LOG_TEST("test_empty_find"); grpc_chttp2_stream_map_init(&map, 8); GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 39128)); @@ -62,7 +62,7 @@ static void test_empty_find(void) { static void test_double_deletion(void) { grpc_chttp2_stream_map map; - LOG_TEST(); + LOG_TEST("test_double_deletion"); grpc_chttp2_stream_map_init(&map, 8); GPR_ASSERT(0 == grpc_chttp2_stream_map_size(&map)); @@ -87,7 +87,7 @@ static void test_basic_add_find(size_t n) { size_t i; size_t got; - LOG_TEST(); + LOG_TEST("test_basic_add_find"); gpr_log(GPR_INFO, "n = %d", n); grpc_chttp2_stream_map_init(&map, 8); @@ -143,7 +143,7 @@ static void test_delete_evens_sweep(size_t n) { grpc_chttp2_stream_map map; size_t i; - LOG_TEST(); + LOG_TEST("test_delete_evens_sweep"); gpr_log(GPR_INFO, "n = %d", n); grpc_chttp2_stream_map_init(&map, 8); @@ -165,7 +165,7 @@ static void test_delete_evens_incremental(size_t n) { grpc_chttp2_stream_map map; size_t i; - LOG_TEST(); + LOG_TEST("test_delete_evens_incremental"); gpr_log(GPR_INFO, "n = %d", n); grpc_chttp2_stream_map_init(&map, 8); @@ -186,7 +186,7 @@ static void test_periodic_compaction(size_t n) { size_t i; size_t del; - LOG_TEST(); + LOG_TEST("test_periodic_compaction"); gpr_log(GPR_INFO, "n = %d", n); grpc_chttp2_stream_map_init(&map, 16); diff --git a/test/core/transport/chttp2/timeout_encoding_test.c b/test/core/transport/chttp2/timeout_encoding_test.c index fdb27a22ced..daaae1d39de 100644 --- a/test/core/transport/chttp2/timeout_encoding_test.c +++ b/test/core/transport/chttp2/timeout_encoding_test.c @@ -42,7 +42,7 @@ #include #include "test/core/util/test_config.h" -#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) +#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x) static void assert_encodes_as(gpr_timespec ts, const char *s) { char buffer[GRPC_CHTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE]; @@ -52,7 +52,7 @@ static void assert_encodes_as(gpr_timespec ts, const char *s) { } void test_encoding(void) { - LOG_TEST(); + LOG_TEST("test_encoding"); assert_encodes_as(gpr_time_from_micros(-1), "1n"); assert_encodes_as(gpr_time_from_seconds(-10), "1n"); assert_encodes_as(gpr_time_from_nanos(10), "10n"); @@ -116,7 +116,7 @@ void decode_suite(char ext, gpr_timespec (*answer)(long x)) { } void test_decoding(void) { - LOG_TEST(); + LOG_TEST("test_decoding"); decode_suite('n', gpr_time_from_nanos); decode_suite('u', gpr_time_from_micros); decode_suite('m', gpr_time_from_millis); @@ -128,7 +128,7 @@ void test_decoding(void) { void test_decoding_fails(void) { gpr_timespec x; - LOG_TEST(); + LOG_TEST("test_decoding_fails"); GPR_ASSERT(0 == grpc_chttp2_decode_timeout("", &x)); GPR_ASSERT(0 == grpc_chttp2_decode_timeout(" ", &x)); GPR_ASSERT(0 == grpc_chttp2_decode_timeout("x", &x)); diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c index 66b5407d3c5..9b242c54935 100644 --- a/test/core/transport/metadata_test.c +++ b/test/core/transport/metadata_test.c @@ -41,7 +41,7 @@ #include #include "test/core/util/test_config.h" -#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) +#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x) /* a large number */ #define MANY 10000 @@ -49,7 +49,7 @@ static void test_no_op(void) { grpc_mdctx *ctx; - LOG_TEST(); + LOG_TEST("test_no_op"); ctx = grpc_mdctx_create(); grpc_mdctx_unref(ctx); @@ -59,7 +59,7 @@ static void test_create_string(void) { grpc_mdctx *ctx; grpc_mdstr *s1, *s2, *s3; - LOG_TEST(); + LOG_TEST("test_create_string"); ctx = grpc_mdctx_create(); s1 = grpc_mdstr_from_string(ctx, "hello"); @@ -79,7 +79,7 @@ static void test_create_metadata(void) { grpc_mdctx *ctx; grpc_mdelem *m1, *m2, *m3; - LOG_TEST(); + LOG_TEST("test_create_metadata"); ctx = grpc_mdctx_create(); m1 = grpc_mdelem_from_strings(ctx, "a", "b"); @@ -104,7 +104,7 @@ static void test_create_many_ephemeral_metadata(void) { long i; size_t mdtab_capacity_before; - LOG_TEST(); + LOG_TEST("test_create_many_ephemeral_metadata"); ctx = grpc_mdctx_create(); mdtab_capacity_before = grpc_mdctx_get_mdtab_capacity_test_only(ctx); @@ -126,7 +126,7 @@ static void test_create_many_persistant_metadata(void) { grpc_mdelem **created = gpr_malloc(sizeof(grpc_mdelem *) * MANY); grpc_mdelem *md; - LOG_TEST(); + LOG_TEST("test_create_many_persistant_metadata"); ctx = grpc_mdctx_create(); /* add phase */ @@ -153,7 +153,7 @@ static void test_create_many_persistant_metadata(void) { static void test_spin_creating_the_same_thing(void) { grpc_mdctx *ctx; - LOG_TEST(); + LOG_TEST("test_spin_creating_the_same_thing"); ctx = grpc_mdctx_create(); GPR_ASSERT(grpc_mdctx_get_mdtab_count_test_only(ctx) == 0); @@ -183,7 +183,7 @@ static void test_things_stick_around(void) { int *shuf = gpr_malloc(sizeof(int) * nstrs); grpc_mdstr *test; - LOG_TEST(); + LOG_TEST("test_things_stick_around"); ctx = grpc_mdctx_create(); @@ -229,7 +229,7 @@ static void test_slices_work(void) { grpc_mdstr *str; gpr_slice slice; - LOG_TEST(); + LOG_TEST("test_slices_work"); ctx = grpc_mdctx_create(); @@ -254,7 +254,7 @@ static void test_base64_and_huffman_works(void) { gpr_slice slice1; gpr_slice slice2; - LOG_TEST(); + LOG_TEST("test_base64_and_huffman_works"); ctx = grpc_mdctx_create(); str = grpc_mdstr_from_string(ctx, "abcdefg"); From 376f2c067246dbf695493dbde67bcf59e46265e0 Mon Sep 17 00:00:00 2001 From: remi Taylor Date: Sun, 24 May 2015 15:08:31 -0700 Subject: [PATCH 15/27] Update node server examples to consistently bind to 50051 --- src/node/examples/math_server.js | 2 +- src/node/examples/stock_server.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/examples/math_server.js b/src/node/examples/math_server.js index 3fac193d641..0a86e7eaffb 100644 --- a/src/node/examples/math_server.js +++ b/src/node/examples/math_server.js @@ -119,7 +119,7 @@ var server = new Server({ }); if (require.main === module) { - server.bind('0.0.0.0:7070'); + server.bind('0.0.0.0:50051'); server.listen(); } diff --git a/src/node/examples/stock_server.js b/src/node/examples/stock_server.js index e475c9cb4cc..8c22af147ed 100644 --- a/src/node/examples/stock_server.js +++ b/src/node/examples/stock_server.js @@ -83,7 +83,7 @@ var stockServer = new StockServer({ }); if (require.main === module) { - stockServer.bind('0.0.0.0:8080'); + stockServer.bind('0.0.0.0:50051'); stockServer.listen(); } From 47b7bd99e6a3501cd5580f17661eeae9e412479f Mon Sep 17 00:00:00 2001 From: remi Taylor Date: Sun, 24 May 2015 15:10:01 -0700 Subject: [PATCH 16/27] Update ruby add_http2_port comments to use port 50051 --- src/ruby/ext/grpc/rb_server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ruby/ext/grpc/rb_server.c b/src/ruby/ext/grpc/rb_server.c index 3182d03fab7..837ca3b5e8d 100644 --- a/src/ruby/ext/grpc/rb_server.c +++ b/src/ruby/ext/grpc/rb_server.c @@ -282,12 +282,12 @@ static VALUE grpc_rb_server_destroy(VALUE self) { call-seq: // insecure port insecure_server = Server.new(cq, {'arg1': 'value1'}) - insecure_server.add_http2_port('mydomain:7575') + insecure_server.add_http2_port('mydomain:50051') // secure port server_creds = ... secure_server = Server.new(cq, {'arg1': 'value1'}) - secure_server.add_http_port('mydomain:7575', server_creds) + secure_server.add_http_port('mydomain:50051', server_creds) Adds a http2 port to server */ static VALUE grpc_rb_server_add_http2_port(int argc, VALUE *argv, VALUE self) { From af74e4e47d543c5450bd0cf29a59e51d4940e020 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Tue, 26 May 2015 11:52:49 -0700 Subject: [PATCH 17/27] Updates gRPC Ruby to 0.9.0 --- src/ruby/lib/grpc/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 072fb9b1aa3..40b6df9a2b6 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -29,5 +29,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '0.6.1' + VERSION = '0.9.0' end From b846b2561d6d1339bf3eac6b3e46b7c3b718a6de Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 26 May 2015 12:45:01 -0700 Subject: [PATCH 18/27] Updated Node.js version to 0.9.0 --- src/node/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/package.json b/src/node/package.json index 3f31ba49ffe..d7e9af07bdd 100644 --- a/src/node/package.json +++ b/src/node/package.json @@ -1,6 +1,6 @@ { "name": "grpc", - "version": "0.8.0", + "version": "0.9.0", "author": "Google Inc.", "description": "gRPC Library for Node", "homepage": "http://www.grpc.io/", From 77e091ebac1850b7404ed99ba185e4520721b149 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 26 May 2015 13:07:21 -0700 Subject: [PATCH 19/27] Workaround: Prevent threads sitting in epoll forever --- src/core/iomgr/pollset_posix.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index ab1af0d4eec..f496ac5bfa7 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -174,6 +174,8 @@ void grpc_pollset_del_fd(grpc_pollset *pollset, grpc_fd *fd) { int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline) { /* pollset->mu already held */ gpr_timespec now = gpr_now(); + /* FIXME(ctiller): see below */ + gpr_timespec maximum_deadline = gpr_time_add(now, gpr_time_from_seconds(1)); int r; if (gpr_time_cmp(now, deadline) > 0) { return 0; @@ -184,6 +186,11 @@ int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline) { if (grpc_alarm_check(&pollset->mu, now, &deadline)) { return 1; } + /* FIXME(ctiller): we should not clamp deadline, however we have some + stuck at shutdown bugs that this resolves */ + if (gpr_time_cmp(deadline, maximum_deadline) > 0) { + deadline = maximum_deadline; + } gpr_tls_set(&g_current_thread_poller, (gpr_intptr)pollset); r = pollset->vtable->maybe_work(pollset, deadline, now, 1); gpr_tls_set(&g_current_thread_poller, 0); From 7eefcb79943ed4132da4f2568a6cec04b2d25427 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Tue, 26 May 2015 14:08:42 -0700 Subject: [PATCH 20/27] Sync Python version to rest of project Updated to version 0.9.0a0. --- src/python/src/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/src/setup.py b/src/python/src/setup.py index e936913cfd0..d0f4791a1e4 100644 --- a/src/python/src/setup.py +++ b/src/python/src/setup.py @@ -86,7 +86,7 @@ _PACKAGE_DIRECTORIES = { setuptools.setup( name='grpcio', - version='0.5.0a2', + version='0.9.0a0', ext_modules=[_EXTENSION_MODULE], packages=list(_PACKAGES), package_dir=_PACKAGE_DIRECTORIES, From d5066b725dc4d82047d2d5ddb33290a110264680 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Wed, 27 May 2015 00:12:04 +0200 Subject: [PATCH 21/27] Updating our protobuf submodule to alpha3 --- third_party/protobuf | 2 +- tools/run_tests/run_sanity.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/protobuf b/third_party/protobuf index a8b38c598d7..8908cf16fe8 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit a8b38c598d7f65b281a72809b28117afdb760931 +Subproject commit 8908cf16fe81f42c766fdf067b1da4554f54ed87 diff --git a/tools/run_tests/run_sanity.sh b/tools/run_tests/run_sanity.sh index 07e559fb038..003e5255268 100755 --- a/tools/run_tests/run_sanity.sh +++ b/tools/run_tests/run_sanity.sh @@ -45,6 +45,6 @@ git submodule > $submodules diff -u $submodules - << EOF 05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f) 3df69d3aefde7671053d4e3c242b228e5d79c83f third_party/openssl (OpenSSL_1_0_2a) - a8b38c598d7f65b281a72809b28117afdb760931 third_party/protobuf (v3.0.0-alpha-1-978-ga8b38c5) + 8908cf16fe81f42c766fdf067b1da4554f54ed87 third_party/protobuf (v3.0.0-alpha-1-1044-g8908cf1) 50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8) EOF From a5861f3414c362f6b2dc78ddfdcc0fa198efe594 Mon Sep 17 00:00:00 2001 From: Xudong Ma Date: Tue, 26 May 2015 15:24:11 -0700 Subject: [PATCH 22/27] Correct the test request/response size, to be consistent with the test spec:https://github.com/grpc/grpc/blob/master/doc/interop-test-descriptions.md --- test/cpp/interop/interop_client.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 874510e54f7..e3510592468 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -57,8 +57,8 @@ const std::vector response_stream_sizes = {31415, 9, 2653, 58979}; const int kNumResponseMessages = 2000; const int kResponseMessageSize = 1030; const int kReceiveDelayMilliSeconds = 20; -const int kLargeRequestSize = 314159; -const int kLargeResponseSize = 271812; +const int kLargeRequestSize = 271828; +const int kLargeResponseSize = 314159; } // namespace InteropClient::InteropClient(std::shared_ptr channel) From 8c67d17edad7900e6e60dcca0e8d13bced78c93a Mon Sep 17 00:00:00 2001 From: Julien Boeuf Date: Tue, 26 May 2015 16:31:19 -0700 Subject: [PATCH 23/27] Standardize on |BIO_pending| and |BIO_wpending|. OpenSSL offers 3 ways to express the same thing: * BIO_ctrl_pending(BIO *) * BIO_ctrl(BIO *, BIO_CTRL_PENDING, 0, NULL) * BIO_pending(BIO *) BoringSSL standardizes on the last of these. --- src/core/tsi/ssl_transport_security.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/tsi/ssl_transport_security.c b/src/core/tsi/ssl_transport_security.c index 9718a0b0489..63b4c42131b 100644 --- a/src/core/tsi/ssl_transport_security.c +++ b/src/core/tsi/ssl_transport_security.c @@ -639,7 +639,7 @@ static tsi_result ssl_protector_protect(tsi_frame_protector* self, tsi_result result = TSI_OK; /* First see if we have some pending data in the SSL BIO. */ - size_t pending_in_ssl = BIO_ctrl_pending(impl->from_ssl); + size_t pending_in_ssl = BIO_pending(impl->from_ssl); if (pending_in_ssl > 0) { *unprotected_bytes_size = 0; read_from_ssl = BIO_read(impl->from_ssl, protected_output_frames, @@ -694,7 +694,7 @@ static tsi_result ssl_protector_protect_flush( impl->buffer_offset = 0; } - *still_pending_size = BIO_ctrl_pending(impl->from_ssl); + *still_pending_size = BIO_pending(impl->from_ssl); if (*still_pending_size == 0) return TSI_OK; read_from_ssl = BIO_read(impl->from_ssl, protected_output_frames, @@ -704,7 +704,7 @@ static tsi_result ssl_protector_protect_flush( return TSI_INTERNAL_ERROR; } *protected_output_frames_size = read_from_ssl; - *still_pending_size = BIO_ctrl_pending(impl->from_ssl); + *still_pending_size = BIO_pending(impl->from_ssl); return TSI_OK; } @@ -782,7 +782,7 @@ static tsi_result ssl_handshaker_get_bytes_to_send_to_peer(tsi_handshaker* self, } } *bytes_size = (size_t)bytes_read_from_ssl; - return BIO_ctrl_pending(impl->from_ssl) == 0 ? TSI_OK : TSI_INCOMPLETE_DATA; + return BIO_pending(impl->from_ssl) == 0 ? TSI_OK : TSI_INCOMPLETE_DATA; } static tsi_result ssl_handshaker_get_result(tsi_handshaker* self) { @@ -818,7 +818,7 @@ static tsi_result ssl_handshaker_process_bytes_from_peer( ssl_result = SSL_get_error(impl->ssl, ssl_result); switch (ssl_result) { case SSL_ERROR_WANT_READ: - if (BIO_ctrl_pending(impl->from_ssl) == 0) { + if (BIO_pending(impl->from_ssl) == 0) { /* We need more data. */ return TSI_INCOMPLETE_DATA; } else { From c39e4aecfd1174febb45d82ac02dbbafb3acfba6 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Tue, 26 May 2015 17:41:16 -0700 Subject: [PATCH 24/27] Add simpler instructions for ObjC (using Homebrew) It also clarifies the Cocoapods part for people new to Cocoapods, and links to the sample app for examples on how to use the generated library. --- src/objective-c/README.md | 104 +++++++++++++++++++++++++++++++------- 1 file changed, 86 insertions(+), 18 deletions(-) diff --git a/src/objective-c/README.md b/src/objective-c/README.md index 49d7f438825..2c3c8cfce43 100644 --- a/src/objective-c/README.md +++ b/src/objective-c/README.md @@ -1,43 +1,104 @@ # gRPC for Objective-C -## How to generate a client library from a Protocol Buffers definition +## Install protoc with the gRPC plugin -First install v3 of the Protocol Buffers compiler (_protoc_), by cloning [its Git repository](https://github.com/google/protobuf) and following these [installation instructions](https://github.com/google/protobuf#c-installation---unix) (the ones titled C++; don't miss the note for Mac users). +On Mac OS X, install [homebrew][]. On Linux, install [linuxbrew][]. -Then clone this repository and execute the following commands from the root directory where it was cloned. +Run the following command to install the Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin: +```sh +$ curl -fsSL https://goo.gl/getgrpc | bash - +``` +This will download and run the [gRPC install script][]. After the command completes, you're ready to proceed. + +## Use protoc to generate a gRPC library + +Run _protoc_ with the following flags to generate the client library for your `.proto` files: -Compile the gRPC plugins for _protoc_: ```sh -make plugins +protoc --objc_out=. --objcgrpc_out=. *.proto ``` -Create a symbolic link to the compiled plugin binary somewhere in your `$PATH`: +This will generate a pair of `.pbobjc.h`/`.pbobjc.m` files for each `.proto` file, with the messages and enums defined in them. And a pair of `.pbrpc.h`/`.pbrpc.m` files for each `.proto` file with services defined. The latter contains the code to make remote calls to the specified API. + +## Integrate the generated gRPC library in your project + +Install [Cocoapods](https://cocoapods.org/#install). + +You need to create a Podspec file for the generated library. You may simply copy the following example to the directory where the source files were generated, updating the name and other metadata of the Podspec as necessary: + +```ruby +Pod::Spec.new do |s| + s.name = '' + s.version = '...' + s.summary = 'Client library to make RPCs to ' + s.homepage = '...' + s.license = '...' + s.authors = { '' => '' } + + s.ios.deployment_target = '6.0' + s.osx.deployment_target = '10.8' + + s.subspec 'Messages' do |ms| + ms.source_files = '*.pbobjc.{h,m}' + ms.requires_arc = false + ms.dependency 'Protobuf', '~> 3.0' + end + + s.subspec 'Services' do |ss| + ss.source_files = '*.pbrpc.{h,m}' + ss.requires_arc = true + ss.dependency 'gRPC', '~> 0.0' + ss.dependency '/Messages' + end +end +``` + +The file should be named `.podspec`. You can refer to this [example Podspec][]. Once your library has a Podspec, Cocoapods can install it into any XCode project. For that, go into your project's directory and create a Podfile by running: + ```sh -ln -s `pwd`/bins/opt/grpc_objective_c_plugin /usr/local/bin/protoc-gen-objcgrpc +pod init ``` -(Notice that the name of the created link must begin with "protoc-gen-" for _protoc_ to recognize it as a plugin). -If you don't want to create the symbolic link, you can alternatively copy the binary (with the appropriate name). Or you might prefer instead to specify the plugin's path as a flag when invoking _protoc_, in which case no system modification nor renaming is necessary. +Next add a line to your Podfile to refer to your library's Podspec. Use `:path` as described [here](https://guides.cocoapods.org/using/the-podfile.html#using-the-files-from-a-folder-local-to-the-machine): + +```ruby +pod '', :path => 'path/to/the/directory/of/your/podspec' +``` -Finally, run _protoc_ with the following flags to generate the client library for your `.proto` files: +You can look at this [example Podfile][]. + +Finally, in your project's directory, run: ```sh -protoc --objc_out=. --objcgrpc_out=. *.proto +pod install ``` -This will generate a pair of `.pbobjc.h`/`.pbobjc.m` files for each `.proto` file, with the messages and enums defined in them. And a pair of `.pbrpc.h`/`.pbrpc.m` files for each `.proto` file with services defined. The latter contains the code to make remote calls to the specified API. +## Use the generated library in your code -## How to integrate a generated gRPC library in your project +Please check this [sample app][] for examples of how to use a generated gRPC library. -### If you use Cocoapods +## Alternative methods -This is the recommended approach. +### Install protoc and the gRPC plugin without using Homebrew -You need to create a Podspec file for the generated library. This is simply a matter of copying an example like [this one](https://github.com/grpc/grpc/blob/master/src/objective-c/examples/Sample/RemoteTestClient/RemoteTest.podspec) to the directory where the source files were generated. Update the name and other metadata of the Podspec as suitable. +First install v3 of the Protocol Buffers compiler (_protoc_), by cloning [its Git repository](https://github.com/google/protobuf) and following these [installation instructions](https://github.com/google/protobuf#c-installation---unix) (the ones titled C++; don't miss the note for Mac users). -Once your library has a Podspec, refer to it from your Podfile using `:path` as described [here](https://guides.cocoapods.org/using/the-podfile.html#using-the-files-from-a-folder-local-to-the-machine). +Then clone this repository and execute the following commands from the root directory where it was cloned. -### If you don't use Cocoapods +Compile the gRPC plugins for _protoc_: +```sh +make plugins +``` + +Create a symbolic link to the compiled plugin binary somewhere in your `$PATH`: +```sh +ln -s `pwd`/bins/opt/grpc_objective_c_plugin /usr/local/bin/protoc-gen-objcgrpc +``` +(Notice that the name of the created link must begin with "protoc-gen-" for _protoc_ to recognize it as a plugin). + +If you don't want to create the symbolic link, you can alternatively copy the binary (with the appropriate name). Or you might prefer instead to specify the plugin's path as a flag when invoking _protoc_, in which case no system modification nor renaming is necessary. + +### Integrate the generated gRPC library without using Cocoapods You need to compile the generated `.pbpbjc.*` files (the enums and messages) without ARC support, and the generated `.pbrpc.*` files (the services) with ARC support. The generated code depends on v0.3+ of the Objective-C gRPC runtime library and v3.0+ of the Objective-C Protobuf runtime library. @@ -45,3 +106,10 @@ These libraries need to be integrated into your project as described in their re * [Podspec](https://github.com/grpc/grpc/blob/master/gRPC.podspec) for the Objective-C gRPC runtime library. This can be tedious to configure manually. * [Podspec](https://github.com/jcanizales/protobuf/blob/add-podspec/Protobuf.podspec) for the Objective-C Protobuf runtime library. + +[homebrew]:http://brew.sh +[linuxbrew]:https://github.com/Homebrew/linuxbrew +[gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install +[example Podspec]:https://github.com/grpc/grpc/blob/master/src/objective-c/examples/Sample/RemoteTestClient/RemoteTest.podspec +[example Podfile]:https://github.com/grpc/grpc/blob/master/src/objective-c/examples/Sample/Podfile +[sample app]: https://github.com/grpc/grpc/tree/master/src/objective-c/examples/Sample From 4ed4e105f5779757d7a36e0c443cd9acbff18356 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Tue, 26 May 2015 17:50:01 -0700 Subject: [PATCH 25/27] Add TOC and anchors in the headers --- src/objective-c/README.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/objective-c/README.md b/src/objective-c/README.md index 2c3c8cfce43..a31e2570d34 100644 --- a/src/objective-c/README.md +++ b/src/objective-c/README.md @@ -1,6 +1,14 @@ # gRPC for Objective-C -## Install protoc with the gRPC plugin +- [Install protoc with the gRPC plugin](#install) +- [Use protoc to generate a gRPC library](#protoc) +- [Integrate the generated gRPC library in your project](#cocoapods) +- [Use the generated library in your code](#use) +- [Alternative methods](#alternatives) + - [Install protoc and the gRPC plugin without using Homebrew](#nohomebrew) + - [Integrate the generated gRPC library without using Cocoapods](#nococoapods) + +## Install protoc with the gRPC plugin On Mac OS X, install [homebrew][]. On Linux, install [linuxbrew][]. @@ -10,7 +18,7 @@ $ curl -fsSL https://goo.gl/getgrpc | bash - ``` This will download and run the [gRPC install script][]. After the command completes, you're ready to proceed. -## Use protoc to generate a gRPC library +## Use protoc to generate a gRPC library Run _protoc_ with the following flags to generate the client library for your `.proto` files: @@ -20,7 +28,7 @@ protoc --objc_out=. --objcgrpc_out=. *.proto This will generate a pair of `.pbobjc.h`/`.pbobjc.m` files for each `.proto` file, with the messages and enums defined in them. And a pair of `.pbrpc.h`/`.pbrpc.m` files for each `.proto` file with services defined. The latter contains the code to make remote calls to the specified API. -## Integrate the generated gRPC library in your project +## Integrate the generated gRPC library in your project Install [Cocoapods](https://cocoapods.org/#install). @@ -73,13 +81,13 @@ Finally, in your project's directory, run: pod install ``` -## Use the generated library in your code +## Use the generated library in your code Please check this [sample app][] for examples of how to use a generated gRPC library. -## Alternative methods +## Alternative methods -### Install protoc and the gRPC plugin without using Homebrew +### Install protoc and the gRPC plugin without using Homebrew First install v3 of the Protocol Buffers compiler (_protoc_), by cloning [its Git repository](https://github.com/google/protobuf) and following these [installation instructions](https://github.com/google/protobuf#c-installation---unix) (the ones titled C++; don't miss the note for Mac users). @@ -98,7 +106,7 @@ ln -s `pwd`/bins/opt/grpc_objective_c_plugin /usr/local/bin/protoc-gen-objcgrpc If you don't want to create the symbolic link, you can alternatively copy the binary (with the appropriate name). Or you might prefer instead to specify the plugin's path as a flag when invoking _protoc_, in which case no system modification nor renaming is necessary. -### Integrate the generated gRPC library without using Cocoapods +### Integrate the generated gRPC library without using Cocoapods You need to compile the generated `.pbpbjc.*` files (the enums and messages) without ARC support, and the generated `.pbrpc.*` files (the services) with ARC support. The generated code depends on v0.3+ of the Objective-C gRPC runtime library and v3.0+ of the Objective-C Protobuf runtime library. From cf685a7368061a0b7a0e94f7723f80df6b54ba69 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Tue, 26 May 2015 17:52:27 -0700 Subject: [PATCH 26/27] Update README.md --- src/objective-c/README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/objective-c/README.md b/src/objective-c/README.md index a31e2570d34..99af14ca0a0 100644 --- a/src/objective-c/README.md +++ b/src/objective-c/README.md @@ -8,7 +8,8 @@ - [Install protoc and the gRPC plugin without using Homebrew](#nohomebrew) - [Integrate the generated gRPC library without using Cocoapods](#nococoapods) -## Install protoc with the gRPC plugin + +## Install protoc with the gRPC plugin On Mac OS X, install [homebrew][]. On Linux, install [linuxbrew][]. @@ -18,7 +19,8 @@ $ curl -fsSL https://goo.gl/getgrpc | bash - ``` This will download and run the [gRPC install script][]. After the command completes, you're ready to proceed. -## Use protoc to generate a gRPC library + +## Use protoc to generate a gRPC library Run _protoc_ with the following flags to generate the client library for your `.proto` files: @@ -28,7 +30,8 @@ protoc --objc_out=. --objcgrpc_out=. *.proto This will generate a pair of `.pbobjc.h`/`.pbobjc.m` files for each `.proto` file, with the messages and enums defined in them. And a pair of `.pbrpc.h`/`.pbrpc.m` files for each `.proto` file with services defined. The latter contains the code to make remote calls to the specified API. -## Integrate the generated gRPC library in your project + +## Integrate the generated gRPC library in your project Install [Cocoapods](https://cocoapods.org/#install). @@ -81,13 +84,15 @@ Finally, in your project's directory, run: pod install ``` -## Use the generated library in your code + +## Use the generated library in your code Please check this [sample app][] for examples of how to use a generated gRPC library. -## Alternative methods + +## Alternative methods -### Install protoc and the gRPC plugin without using Homebrew +### Install protoc and the gRPC plugin without using Homebrew First install v3 of the Protocol Buffers compiler (_protoc_), by cloning [its Git repository](https://github.com/google/protobuf) and following these [installation instructions](https://github.com/google/protobuf#c-installation---unix) (the ones titled C++; don't miss the note for Mac users). From 4432330242714fe498a08e10ba086d0fcfa26f49 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Tue, 26 May 2015 17:53:37 -0700 Subject: [PATCH 27/27] Move anchors above headers, so TOC links work properly --- src/objective-c/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/objective-c/README.md b/src/objective-c/README.md index 99af14ca0a0..167016cc2c3 100644 --- a/src/objective-c/README.md +++ b/src/objective-c/README.md @@ -92,7 +92,8 @@ Please check this [sample app][] for examples of how to use a generated gRPC lib ## Alternative methods -### Install protoc and the gRPC plugin without using Homebrew + +### Install protoc and the gRPC plugin without using Homebrew First install v3 of the Protocol Buffers compiler (_protoc_), by cloning [its Git repository](https://github.com/google/protobuf) and following these [installation instructions](https://github.com/google/protobuf#c-installation---unix) (the ones titled C++; don't miss the note for Mac users). @@ -111,7 +112,8 @@ ln -s `pwd`/bins/opt/grpc_objective_c_plugin /usr/local/bin/protoc-gen-objcgrpc If you don't want to create the symbolic link, you can alternatively copy the binary (with the appropriate name). Or you might prefer instead to specify the plugin's path as a flag when invoking _protoc_, in which case no system modification nor renaming is necessary. -### Integrate the generated gRPC library without using Cocoapods + +### Integrate the generated gRPC library without using Cocoapods You need to compile the generated `.pbpbjc.*` files (the enums and messages) without ARC support, and the generated `.pbrpc.*` files (the services) with ARC support. The generated code depends on v0.3+ of the Objective-C gRPC runtime library and v3.0+ of the Objective-C Protobuf runtime library.