grpc 0.14.1 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (277) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +1398 -817
  3. data/include/grpc/compression.h +2 -1
  4. data/include/grpc/grpc.h +10 -1
  5. data/include/grpc/grpc_cronet.h +51 -0
  6. data/include/grpc/grpc_posix.h +70 -0
  7. data/include/grpc/impl/codegen/atm.h +2 -2
  8. data/include/grpc/impl/codegen/{atm_win32.h → atm_windows.h} +3 -3
  9. data/include/grpc/impl/codegen/compression_types.h +39 -5
  10. data/include/grpc/impl/codegen/connectivity_state.h +1 -1
  11. data/include/grpc/impl/codegen/grpc_types.h +10 -0
  12. data/include/grpc/impl/codegen/log.h +2 -1
  13. data/include/grpc/impl/codegen/port_platform.h +30 -12
  14. data/include/grpc/impl/codegen/slice_buffer.h +2 -3
  15. data/include/grpc/impl/codegen/sync.h +2 -2
  16. data/include/grpc/impl/codegen/{sync_win32.h → sync_windows.h} +3 -3
  17. data/include/grpc/support/{sync_win32.h → atm_windows.h} +4 -4
  18. data/include/grpc/support/avl.h +5 -0
  19. data/include/grpc/support/{log_win32.h → log_windows.h} +3 -3
  20. data/include/grpc/support/string_util.h +2 -1
  21. data/include/grpc/support/{atm_win32.h → sync_windows.h} +4 -4
  22. data/src/core/ext/census/gen/census.pb.c +179 -0
  23. data/src/core/ext/census/gen/census.pb.h +294 -0
  24. data/src/core/ext/census/grpc_filter.c +11 -7
  25. data/src/core/ext/client_config/channel_connectivity.c +28 -14
  26. data/src/core/ext/client_config/client_channel.c +77 -53
  27. data/src/core/ext/client_config/connector.h +1 -1
  28. data/src/core/ext/client_config/lb_policy.c +9 -6
  29. data/src/core/ext/client_config/lb_policy.h +9 -5
  30. data/src/core/ext/client_config/subchannel.c +58 -39
  31. data/src/core/ext/client_config/subchannel.h +3 -2
  32. data/src/core/ext/client_config/subchannel_call_holder.c +34 -19
  33. data/src/core/ext/client_config/subchannel_call_holder.h +2 -1
  34. data/src/core/ext/client_config/subchannel_index.c +20 -9
  35. data/src/core/ext/lb_policy/grpclb/load_balancer_api.c +7 -7
  36. data/src/core/ext/lb_policy/grpclb/load_balancer_api.h +5 -5
  37. data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/{v0 → v1}/load_balancer.pb.c +29 -30
  38. data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +178 -0
  39. data/src/core/ext/lb_policy/pick_first/pick_first.c +65 -45
  40. data/src/core/ext/lb_policy/round_robin/round_robin.c +84 -43
  41. data/src/core/ext/load_reporting/load_reporting.c +133 -0
  42. data/src/core/ext/load_reporting/load_reporting.h +75 -0
  43. data/src/core/ext/load_reporting/load_reporting_filter.c +151 -0
  44. data/src/core/ext/load_reporting/load_reporting_filter.h +41 -0
  45. data/src/core/ext/resolver/dns/native/dns_resolver.c +22 -8
  46. data/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +2 -2
  47. data/src/core/ext/transport/chttp2/client/insecure/channel_create.c +4 -4
  48. data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c +95 -0
  49. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +14 -18
  50. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c +49 -24
  51. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c +82 -0
  52. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +104 -60
  53. data/src/core/ext/transport/chttp2/transport/bin_decoder.c +232 -0
  54. data/src/{ruby/ext/grpc/rb_signal.c → core/ext/transport/chttp2/transport/bin_decoder.h} +27 -31
  55. data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +481 -260
  56. data/src/core/ext/transport/chttp2/transport/frame.h +1 -7
  57. data/src/core/ext/transport/chttp2/transport/frame_data.c +44 -27
  58. data/src/core/ext/transport/chttp2/transport/frame_data.h +6 -5
  59. data/src/core/ext/transport/chttp2/transport/frame_goaway.c +23 -17
  60. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +2 -2
  61. data/src/core/ext/transport/chttp2/transport/frame_ping.c +12 -7
  62. data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -3
  63. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +25 -12
  64. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +2 -2
  65. data/src/core/ext/transport/chttp2/transport/frame_settings.c +23 -21
  66. data/src/core/ext/transport/chttp2/transport/frame_settings.h +2 -2
  67. data/src/core/ext/transport/chttp2/transport/frame_window_update.c +17 -9
  68. data/src/core/ext/transport/chttp2/transport/frame_window_update.h +2 -2
  69. data/src/core/ext/transport/chttp2/transport/hpack_parser.c +365 -287
  70. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +8 -6
  71. data/src/core/ext/transport/chttp2/transport/hpack_table.c +24 -20
  72. data/src/core/ext/transport/chttp2/transport/hpack_table.h +5 -4
  73. data/src/core/ext/transport/chttp2/transport/incoming_metadata.c +1 -0
  74. data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +1 -0
  75. data/src/core/ext/transport/chttp2/transport/internal.h +34 -32
  76. data/src/core/ext/transport/chttp2/transport/parsing.c +296 -212
  77. data/src/core/ext/transport/chttp2/transport/writing.c +12 -9
  78. data/src/core/lib/channel/channel_args.c +26 -12
  79. data/src/core/lib/channel/channel_args.h +1 -1
  80. data/src/core/lib/channel/channel_stack.c +12 -8
  81. data/src/core/lib/channel/channel_stack.h +27 -11
  82. data/src/core/lib/channel/channel_stack_builder.c +2 -2
  83. data/src/core/lib/channel/compress_filter.c +26 -31
  84. data/src/core/lib/channel/compress_filter.h +4 -4
  85. data/src/core/lib/channel/connected_channel.c +7 -5
  86. data/src/core/lib/channel/http_client_filter.c +34 -8
  87. data/src/core/lib/channel/http_client_filter.h +1 -1
  88. data/src/core/lib/channel/http_server_filter.c +21 -12
  89. data/src/core/lib/compression/{compression_algorithm.c → compression.c} +22 -21
  90. data/src/core/lib/http/httpcli.c +81 -59
  91. data/src/core/lib/http/httpcli.h +11 -15
  92. data/src/core/lib/http/httpcli_security_connector.c +5 -3
  93. data/src/core/lib/http/parser.c +127 -118
  94. data/src/core/lib/http/parser.h +11 -6
  95. data/src/core/lib/iomgr/closure.c +20 -16
  96. data/src/core/lib/iomgr/closure.h +19 -15
  97. data/src/core/lib/iomgr/endpoint.h +1 -1
  98. data/src/core/lib/iomgr/endpoint_pair_posix.c +2 -2
  99. data/src/core/lib/iomgr/error.c +535 -0
  100. data/src/core/lib/iomgr/error.h +192 -0
  101. data/src/core/lib/iomgr/ev_poll_and_epoll_posix.c +190 -83
  102. data/src/core/lib/iomgr/ev_poll_posix.c +1267 -0
  103. data/src/{ruby/ext/grpc/rb_signal.h → core/lib/iomgr/ev_poll_posix.h} +7 -5
  104. data/src/core/lib/iomgr/ev_posix.c +104 -14
  105. data/src/core/lib/iomgr/ev_posix.h +17 -7
  106. data/src/core/lib/iomgr/exec_ctx.c +25 -7
  107. data/src/core/lib/iomgr/exec_ctx.h +27 -8
  108. data/src/core/lib/iomgr/executor.c +2 -2
  109. data/src/core/lib/iomgr/executor.h +1 -1
  110. data/src/core/lib/iomgr/iocp_windows.c +2 -41
  111. data/src/core/lib/iomgr/iocp_windows.h +0 -8
  112. data/src/core/lib/iomgr/iomgr.c +5 -4
  113. data/src/core/lib/iomgr/iomgr_posix.c +5 -1
  114. data/src/core/lib/iomgr/iomgr_windows.c +1 -1
  115. data/src/core/lib/{support → iomgr}/load_file.c +15 -17
  116. data/src/core/lib/{support → iomgr}/load_file.h +8 -7
  117. data/src/core/lib/iomgr/polling_entity.c +104 -0
  118. data/src/core/lib/iomgr/polling_entity.h +81 -0
  119. data/src/core/lib/iomgr/pollset.h +6 -5
  120. data/src/core/lib/iomgr/pollset_set_windows.c +4 -1
  121. data/src/core/lib/iomgr/pollset_windows.c +10 -6
  122. data/src/core/lib/iomgr/resolve_address.h +5 -9
  123. data/src/core/lib/iomgr/resolve_address_posix.c +55 -38
  124. data/src/core/lib/iomgr/resolve_address_windows.c +51 -37
  125. data/src/core/lib/iomgr/sockaddr.h +2 -2
  126. data/src/core/lib/iomgr/{sockaddr_win32.h → sockaddr_windows.h} +3 -3
  127. data/src/core/lib/iomgr/socket_utils_common_posix.c +92 -45
  128. data/src/core/lib/iomgr/socket_utils_posix.h +19 -12
  129. data/src/core/lib/iomgr/socket_windows.c +61 -2
  130. data/src/core/lib/iomgr/socket_windows.h +13 -0
  131. data/src/core/lib/iomgr/tcp_client_posix.c +54 -39
  132. data/src/core/lib/iomgr/tcp_client_windows.c +34 -34
  133. data/src/core/lib/iomgr/tcp_posix.c +43 -39
  134. data/src/core/lib/iomgr/tcp_server.h +5 -3
  135. data/src/core/lib/iomgr/tcp_server_posix.c +103 -64
  136. data/src/core/lib/iomgr/tcp_server_windows.c +114 -101
  137. data/src/core/lib/iomgr/tcp_windows.c +45 -50
  138. data/src/core/lib/iomgr/tcp_windows.h +1 -1
  139. data/src/core/lib/iomgr/timer.c +26 -13
  140. data/src/core/lib/iomgr/udp_server.c +28 -4
  141. data/src/core/lib/iomgr/udp_server.h +5 -1
  142. data/src/core/lib/iomgr/unix_sockets_posix.c +8 -7
  143. data/src/core/lib/iomgr/unix_sockets_posix.h +2 -1
  144. data/src/core/lib/iomgr/unix_sockets_posix_noop.c +4 -2
  145. data/src/core/lib/iomgr/wakeup_fd_eventfd.c +15 -5
  146. data/src/core/lib/iomgr/wakeup_fd_pipe.c +13 -9
  147. data/src/core/lib/iomgr/wakeup_fd_posix.c +6 -6
  148. data/src/core/lib/iomgr/wakeup_fd_posix.h +9 -6
  149. data/src/core/lib/iomgr/workqueue.h +5 -4
  150. data/src/core/lib/iomgr/workqueue_posix.c +40 -26
  151. data/src/core/lib/iomgr/workqueue_windows.c +2 -2
  152. data/src/core/lib/profiling/basic_timers.c +2 -2
  153. data/src/core/lib/security/{security_context.c → context/security_context.c} +1 -1
  154. data/src/core/lib/security/{security_context.h → context/security_context.h} +4 -4
  155. data/src/core/lib/security/credentials/composite/composite_credentials.c +263 -0
  156. data/src/core/lib/security/credentials/composite/composite_credentials.h +72 -0
  157. data/src/core/lib/security/credentials/credentials.c +233 -0
  158. data/src/core/lib/security/{credentials.h → credentials/credentials.h} +19 -157
  159. data/src/core/lib/security/{credentials_metadata.c → credentials/credentials_metadata.c} +1 -1
  160. data/src/core/lib/security/credentials/fake/fake_credentials.c +139 -0
  161. data/src/core/lib/security/credentials/fake/fake_credentials.h +56 -0
  162. data/src/core/lib/security/{credentials_posix.c → credentials/google_default/credentials_posix.c} +1 -1
  163. data/src/core/lib/security/{credentials_win32.c → credentials/google_default/credentials_windows.c} +3 -3
  164. data/src/core/lib/security/{google_default_credentials.c → credentials/google_default/google_default_credentials.c} +93 -35
  165. data/src/core/lib/security/credentials/google_default/google_default_credentials.h +46 -0
  166. data/src/core/lib/security/credentials/iam/iam_credentials.c +85 -0
  167. data/src/core/lib/security/credentials/iam/iam_credentials.h +44 -0
  168. data/src/core/lib/security/{json_token.c → credentials/jwt/json_token.c} +10 -101
  169. data/src/core/lib/security/{json_token.h → credentials/jwt/json_token.h} +3 -33
  170. data/src/core/lib/security/credentials/jwt/jwt_credentials.c +160 -0
  171. data/src/core/lib/security/credentials/jwt/jwt_credentials.h +62 -0
  172. data/src/core/lib/security/{jwt_verifier.c → credentials/jwt/jwt_verifier.c} +35 -15
  173. data/src/core/lib/security/{jwt_verifier.h → credentials/jwt/jwt_verifier.h} +3 -3
  174. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.c +433 -0
  175. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +109 -0
  176. data/src/core/lib/security/credentials/plugin/plugin_credentials.c +129 -0
  177. data/src/core/lib/security/credentials/plugin/plugin_credentials.h +45 -0
  178. data/src/core/lib/security/credentials/ssl/ssl_credentials.c +240 -0
  179. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +48 -0
  180. data/src/core/lib/security/{auth_filters.h → transport/auth_filters.h} +3 -3
  181. data/src/core/lib/security/{client_auth_filter.c → transport/client_auth_filter.c} +27 -20
  182. data/src/core/lib/security/{handshake.c → transport/handshake.c} +77 -45
  183. data/src/core/lib/security/{handshake.h → transport/handshake.h} +9 -11
  184. data/src/core/lib/security/{secure_endpoint.c → transport/secure_endpoint.c} +19 -12
  185. data/src/core/lib/security/{secure_endpoint.h → transport/secure_endpoint.h} +3 -3
  186. data/src/core/lib/security/{security_connector.c → transport/security_connector.c} +26 -17
  187. data/src/core/lib/security/{security_connector.h → transport/security_connector.h} +8 -8
  188. data/src/core/lib/security/{server_auth_filter.c → transport/server_auth_filter.c} +24 -16
  189. data/src/core/lib/security/transport/tsi_error.c +40 -0
  190. data/src/core/lib/security/transport/tsi_error.h +42 -0
  191. data/src/core/lib/security/{b64.c → util/b64.c} +1 -1
  192. data/src/core/lib/security/{b64.h → util/b64.h} +3 -3
  193. data/src/core/lib/security/util/json_util.c +61 -0
  194. data/src/core/lib/security/util/json_util.h +55 -0
  195. data/src/core/lib/support/avl.c +11 -0
  196. data/src/core/lib/support/cpu_windows.c +2 -2
  197. data/src/core/lib/support/{env_win32.c → env_windows.c} +3 -3
  198. data/src/core/lib/support/log.c +3 -1
  199. data/src/core/lib/support/log_linux.c +2 -2
  200. data/src/core/lib/support/{log_win32.c → log_windows.c} +4 -4
  201. data/src/core/lib/support/murmur_hash.c +3 -5
  202. data/src/core/lib/support/string.c +10 -0
  203. data/src/core/lib/support/string.h +4 -0
  204. data/src/core/lib/support/{string_util_win32.c → string_util_windows.c} +3 -3
  205. data/src/core/lib/support/{string_win32.c → string_windows.c} +2 -2
  206. data/src/core/lib/support/{string_win32.h → string_windows.h} +5 -5
  207. data/src/core/lib/support/subprocess_windows.c +1 -1
  208. data/src/core/lib/support/{sync_win32.c → sync_windows.c} +2 -2
  209. data/src/core/lib/support/{thd_win32.c → thd_windows.c} +2 -2
  210. data/src/core/lib/support/{time_win32.c → time_windows.c} +2 -2
  211. data/src/core/lib/support/tmpfile_msys.c +1 -1
  212. data/src/core/lib/support/{tmpfile_win32.c → tmpfile_windows.c} +3 -3
  213. data/src/core/lib/surface/alarm.c +2 -2
  214. data/src/core/lib/surface/byte_buffer_reader.c +13 -6
  215. data/src/core/lib/surface/call.c +323 -123
  216. data/src/core/lib/surface/call.h +2 -0
  217. data/src/core/lib/surface/call_log_batch.c +1 -1
  218. data/src/core/lib/surface/channel.c +64 -15
  219. data/src/core/lib/surface/channel.h +9 -0
  220. data/src/core/lib/surface/channel_ping.c +3 -3
  221. data/src/core/lib/surface/completion_queue.c +75 -19
  222. data/src/core/lib/surface/completion_queue.h +7 -2
  223. data/src/core/lib/surface/init.c +2 -1
  224. data/src/core/lib/surface/init_secure.c +4 -4
  225. data/src/core/lib/surface/lame_client.c +12 -8
  226. data/src/core/lib/surface/server.c +213 -120
  227. data/src/core/lib/surface/server.h +1 -0
  228. data/src/core/lib/surface/version.c +1 -1
  229. data/src/core/lib/transport/connectivity_state.c +40 -18
  230. data/src/core/lib/transport/connectivity_state.h +4 -1
  231. data/src/core/lib/transport/metadata.c +23 -23
  232. data/src/core/lib/transport/metadata.h +4 -0
  233. data/src/core/lib/transport/metadata_batch.c +9 -0
  234. data/src/core/lib/transport/metadata_batch.h +3 -0
  235. data/src/core/lib/transport/static_metadata.c +6 -5
  236. data/src/core/lib/transport/static_metadata.h +64 -60
  237. data/src/core/lib/transport/transport.c +24 -12
  238. data/src/core/lib/transport/transport.h +6 -5
  239. data/src/core/lib/transport/transport_impl.h +4 -0
  240. data/src/core/lib/transport/transport_op_string.c +2 -2
  241. data/src/core/plugin_registry/grpc_plugin_registry.c +4 -0
  242. data/src/ruby/bin/math_services.rb +41 -2
  243. data/src/ruby/ext/grpc/rb_call.c +42 -40
  244. data/src/ruby/ext/grpc/rb_channel.c +1 -1
  245. data/src/ruby/ext/grpc/rb_completion_queue.c +59 -6
  246. data/src/ruby/ext/grpc/rb_completion_queue.h +1 -1
  247. data/src/ruby/ext/grpc/rb_grpc.c +1 -3
  248. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -2
  249. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +21 -5
  250. data/src/ruby/ext/grpc/rb_loader.c +1 -1
  251. data/src/ruby/ext/grpc/rb_server.c +5 -3
  252. data/src/ruby/lib/grpc.rb +0 -3
  253. data/src/ruby/lib/grpc/errors.rb +3 -2
  254. data/src/ruby/lib/grpc/generic/active_call.rb +32 -42
  255. data/src/ruby/lib/grpc/generic/bidi_call.rb +20 -0
  256. data/src/ruby/lib/grpc/generic/client_stub.rb +31 -54
  257. data/src/ruby/lib/grpc/generic/rpc_desc.rb +4 -4
  258. data/src/ruby/lib/grpc/generic/rpc_server.rb +12 -23
  259. data/src/ruby/lib/grpc/generic/service.rb +8 -8
  260. data/src/ruby/lib/grpc/version.rb +1 -1
  261. data/src/ruby/pb/grpc/health/v1/health_services.rb +30 -2
  262. data/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services.rb +34 -4
  263. data/src/ruby/pb/grpc/testing/metrics_services.rb +39 -2
  264. data/src/ruby/pb/src/proto/grpc/testing/empty.rb +15 -0
  265. data/src/ruby/pb/src/proto/grpc/testing/messages.rb +84 -0
  266. data/src/ruby/pb/src/proto/grpc/testing/test.rb +14 -0
  267. data/src/ruby/pb/src/proto/grpc/testing/test_services.rb +110 -0
  268. data/src/ruby/pb/test/client.rb +5 -2
  269. data/src/ruby/spec/generic/active_call_spec.rb +3 -2
  270. data/src/ruby/spec/generic/client_stub_spec.rb +27 -24
  271. data/src/ruby/spec/generic/rpc_desc_spec.rb +11 -11
  272. data/src/ruby/spec/generic/rpc_server_spec.rb +42 -61
  273. data/src/ruby/spec/pb/health/checker_spec.rb +3 -5
  274. metadata +86 -48
  275. data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h +0 -182
  276. data/src/core/lib/security/credentials.c +0 -1296
  277. data/src/ruby/lib/grpc/signals.rb +0 -69
@@ -1,15 +1,45 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: src/proto/grpc/testing/duplicate/echo_duplicate.proto for package 'grpc.testing.duplicate'
2
+ # Source: grpc/testing/duplicate/echo_duplicate.proto for package 'grpc.testing.duplicate'
3
+ # Original file comments:
4
+ # Copyright 2015, Google Inc.
5
+ # All rights reserved.
6
+ #
7
+ # Redistribution and use in source and binary forms, with or without
8
+ # modification, are permitted provided that the following conditions are
9
+ # met:
10
+ #
11
+ # * Redistributions of source code must retain the above copyright
12
+ # notice, this list of conditions and the following disclaimer.
13
+ # * Redistributions in binary form must reproduce the above
14
+ # copyright notice, this list of conditions and the following disclaimer
15
+ # in the documentation and/or other materials provided with the
16
+ # distribution.
17
+ # * Neither the name of Google Inc. nor the names of its
18
+ # contributors may be used to endorse or promote products derived from
19
+ # this software without specific prior written permission.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ #
33
+ # This is a partial copy of echo.proto with a different package name.
34
+ #
3
35
 
4
36
  require 'grpc'
5
- require 'src/proto/grpc/testing/duplicate/echo_duplicate'
37
+ require 'grpc/testing/duplicate/echo_duplicate'
6
38
 
7
39
  module Grpc
8
40
  module Testing
9
41
  module Duplicate
10
42
  module EchoTestService
11
-
12
- # TODO: add proto service documentation here
13
43
  class Service
14
44
 
15
45
  include GRPC::GenericService
@@ -1,5 +1,41 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: grpc/testing/metrics.proto for package 'grpc.testing'
3
+ # Original file comments:
4
+ # Copyright 2015-2016, Google Inc.
5
+ # All rights reserved.
6
+ #
7
+ # Redistribution and use in source and binary forms, with or without
8
+ # modification, are permitted provided that the following conditions are
9
+ # met:
10
+ #
11
+ # * Redistributions of source code must retain the above copyright
12
+ # notice, this list of conditions and the following disclaimer.
13
+ # * Redistributions in binary form must reproduce the above
14
+ # copyright notice, this list of conditions and the following disclaimer
15
+ # in the documentation and/or other materials provided with the
16
+ # distribution.
17
+ # * Neither the name of Google Inc. nor the names of its
18
+ # contributors may be used to endorse or promote products derived from
19
+ # this software without specific prior written permission.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ #
33
+ # Contains the definitions for a metrics service and the type of metrics
34
+ # exposed by the service.
35
+ #
36
+ # Currently, 'Gauge' (i.e a metric that represents the measured value of
37
+ # something at an instant of time) is the only metric type supported by the
38
+ # service.
3
39
 
4
40
  require 'grpc'
5
41
  require 'grpc/testing/metrics'
@@ -7,8 +43,6 @@ require 'grpc/testing/metrics'
7
43
  module Grpc
8
44
  module Testing
9
45
  module MetricsService
10
-
11
- # TODO: add proto service documentation here
12
46
  class Service
13
47
 
14
48
  include GRPC::GenericService
@@ -17,7 +51,10 @@ module Grpc
17
51
  self.unmarshal_class_method = :decode
18
52
  self.service_name = 'grpc.testing.MetricsService'
19
53
 
54
+ # Returns the values of all the gauges that are currently being maintained by
55
+ # the service
20
56
  rpc :GetAllGauges, EmptyMessage, stream(GaugeResponse)
57
+ # Returns the value of one gauge
21
58
  rpc :GetGauge, GaugeRequest, GaugeResponse
22
59
  end
23
60
 
@@ -0,0 +1,15 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: src/proto/grpc/testing/empty.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "grpc.testing.Empty" do
8
+ end
9
+ end
10
+
11
+ module Grpc
12
+ module Testing
13
+ Empty = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Empty").msgclass
14
+ end
15
+ end
@@ -0,0 +1,84 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: src/proto/grpc/testing/messages.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "grpc.testing.Payload" do
8
+ optional :type, :enum, 1, "grpc.testing.PayloadType"
9
+ optional :body, :bytes, 2
10
+ end
11
+ add_message "grpc.testing.EchoStatus" do
12
+ optional :code, :int32, 1
13
+ optional :message, :string, 2
14
+ end
15
+ add_message "grpc.testing.SimpleRequest" do
16
+ optional :response_type, :enum, 1, "grpc.testing.PayloadType"
17
+ optional :response_size, :int32, 2
18
+ optional :payload, :message, 3, "grpc.testing.Payload"
19
+ optional :fill_username, :bool, 4
20
+ optional :fill_oauth_scope, :bool, 5
21
+ optional :response_compression, :enum, 6, "grpc.testing.CompressionType"
22
+ optional :response_status, :message, 7, "grpc.testing.EchoStatus"
23
+ end
24
+ add_message "grpc.testing.SimpleResponse" do
25
+ optional :payload, :message, 1, "grpc.testing.Payload"
26
+ optional :username, :string, 2
27
+ optional :oauth_scope, :string, 3
28
+ end
29
+ add_message "grpc.testing.StreamingInputCallRequest" do
30
+ optional :payload, :message, 1, "grpc.testing.Payload"
31
+ end
32
+ add_message "grpc.testing.StreamingInputCallResponse" do
33
+ optional :aggregated_payload_size, :int32, 1
34
+ end
35
+ add_message "grpc.testing.ResponseParameters" do
36
+ optional :size, :int32, 1
37
+ optional :interval_us, :int32, 2
38
+ end
39
+ add_message "grpc.testing.StreamingOutputCallRequest" do
40
+ optional :response_type, :enum, 1, "grpc.testing.PayloadType"
41
+ repeated :response_parameters, :message, 2, "grpc.testing.ResponseParameters"
42
+ optional :payload, :message, 3, "grpc.testing.Payload"
43
+ optional :response_compression, :enum, 6, "grpc.testing.CompressionType"
44
+ optional :response_status, :message, 7, "grpc.testing.EchoStatus"
45
+ end
46
+ add_message "grpc.testing.StreamingOutputCallResponse" do
47
+ optional :payload, :message, 1, "grpc.testing.Payload"
48
+ end
49
+ add_message "grpc.testing.ReconnectParams" do
50
+ optional :max_reconnect_backoff_ms, :int32, 1
51
+ end
52
+ add_message "grpc.testing.ReconnectInfo" do
53
+ optional :passed, :bool, 1
54
+ repeated :backoff_ms, :int32, 2
55
+ end
56
+ add_enum "grpc.testing.PayloadType" do
57
+ value :COMPRESSABLE, 0
58
+ value :UNCOMPRESSABLE, 1
59
+ value :RANDOM, 2
60
+ end
61
+ add_enum "grpc.testing.CompressionType" do
62
+ value :NONE, 0
63
+ value :GZIP, 1
64
+ value :DEFLATE, 2
65
+ end
66
+ end
67
+
68
+ module Grpc
69
+ module Testing
70
+ Payload = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Payload").msgclass
71
+ EchoStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EchoStatus").msgclass
72
+ SimpleRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleRequest").msgclass
73
+ SimpleResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleResponse").msgclass
74
+ StreamingInputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallRequest").msgclass
75
+ StreamingInputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallResponse").msgclass
76
+ ResponseParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ResponseParameters").msgclass
77
+ StreamingOutputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallRequest").msgclass
78
+ StreamingOutputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallResponse").msgclass
79
+ ReconnectParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectParams").msgclass
80
+ ReconnectInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass
81
+ PayloadType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
82
+ CompressionType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.CompressionType").enummodule
83
+ end
84
+ end
@@ -0,0 +1,14 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: src/proto/grpc/testing/test.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'src/proto/grpc/testing/empty'
7
+ require 'src/proto/grpc/testing/messages'
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ end
10
+
11
+ module Grpc
12
+ module Testing
13
+ end
14
+ end
@@ -0,0 +1,110 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: src/proto/grpc/testing/test.proto for package 'grpc.testing'
3
+ # Original file comments:
4
+ # Copyright 2015-2016, Google Inc.
5
+ # All rights reserved.
6
+ #
7
+ # Redistribution and use in source and binary forms, with or without
8
+ # modification, are permitted provided that the following conditions are
9
+ # met:
10
+ #
11
+ # * Redistributions of source code must retain the above copyright
12
+ # notice, this list of conditions and the following disclaimer.
13
+ # * Redistributions in binary form must reproduce the above
14
+ # copyright notice, this list of conditions and the following disclaimer
15
+ # in the documentation and/or other materials provided with the
16
+ # distribution.
17
+ # * Neither the name of Google Inc. nor the names of its
18
+ # contributors may be used to endorse or promote products derived from
19
+ # this software without specific prior written permission.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ #
33
+ # An integration test service that covers all the method signature permutations
34
+ # of unary/streaming requests/responses.
35
+ #
36
+
37
+ require 'grpc'
38
+ require 'src/proto/grpc/testing/test'
39
+
40
+ module Grpc
41
+ module Testing
42
+ module TestService
43
+ # A simple service to test the various types of RPCs and experiment with
44
+ # performance with various types of payload.
45
+ class Service
46
+
47
+ include GRPC::GenericService
48
+
49
+ self.marshal_class_method = :encode
50
+ self.unmarshal_class_method = :decode
51
+ self.service_name = 'grpc.testing.TestService'
52
+
53
+ # One empty request followed by one empty response.
54
+ rpc :EmptyCall, Empty, Empty
55
+ # One request followed by one response.
56
+ rpc :UnaryCall, SimpleRequest, SimpleResponse
57
+ # One request followed by a sequence of responses (streamed download).
58
+ # The server returns the payload with client desired type and sizes.
59
+ rpc :StreamingOutputCall, StreamingOutputCallRequest, stream(StreamingOutputCallResponse)
60
+ # A sequence of requests followed by one response (streamed upload).
61
+ # The server returns the aggregated size of client payload as the result.
62
+ rpc :StreamingInputCall, stream(StreamingInputCallRequest), StreamingInputCallResponse
63
+ # A sequence of requests with each request served by the server immediately.
64
+ # As one request could lead to multiple responses, this interface
65
+ # demonstrates the idea of full duplexing.
66
+ rpc :FullDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
67
+ # A sequence of requests followed by a sequence of responses.
68
+ # The server buffers all the client requests and then serves them in order. A
69
+ # stream of responses are returned to the client when the server starts with
70
+ # first request.
71
+ rpc :HalfDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
72
+ end
73
+
74
+ Stub = Service.rpc_stub_class
75
+ end
76
+ module UnimplementedService
77
+ # A simple service NOT implemented at servers so clients can test for
78
+ # that case.
79
+ class Service
80
+
81
+ include GRPC::GenericService
82
+
83
+ self.marshal_class_method = :encode
84
+ self.unmarshal_class_method = :decode
85
+ self.service_name = 'grpc.testing.UnimplementedService'
86
+
87
+ # A call that no server should implement
88
+ rpc :UnimplementedCall, Empty, Empty
89
+ end
90
+
91
+ Stub = Service.rpc_stub_class
92
+ end
93
+ module ReconnectService
94
+ # A service used to control reconnect server.
95
+ class Service
96
+
97
+ include GRPC::GenericService
98
+
99
+ self.marshal_class_method = :encode
100
+ self.unmarshal_class_method = :decode
101
+ self.service_name = 'grpc.testing.ReconnectService'
102
+
103
+ rpc :Start, ReconnectParams, Empty
104
+ rpc :Stop, Empty, ReconnectInfo
105
+ end
106
+
107
+ Stub = Service.rpc_stub_class
108
+ end
109
+ end
110
+ end
@@ -114,7 +114,9 @@ def create_stub(opts)
114
114
  if opts.secure
115
115
  creds = ssl_creds(opts.use_test_ca)
116
116
  stub_opts = {
117
- GRPC::Core::Channel::SSL_TARGET => opts.host_override
117
+ channel_args: {
118
+ GRPC::Core::Channel::SSL_TARGET => opts.host_override
119
+ }
118
120
  }
119
121
 
120
122
  # Add service account creds if specified
@@ -315,7 +317,8 @@ class NamedTests
315
317
  def timeout_on_sleeping_server
316
318
  msg_sizes = [[27_182, 31_415]]
317
319
  ppp = PingPongPlayer.new(msg_sizes)
318
- resps = @stub.full_duplex_call(ppp.each_item, timeout: 0.001)
320
+ deadline = GRPC::Core::TimeConsts::from_relative_time(0.001)
321
+ resps = @stub.full_duplex_call(ppp.each_item, deadline: deadline)
319
322
  resps.each { |r| ppp.queue.push(r) }
320
323
  fail 'Should have raised GRPC::BadStatus(DEADLINE_EXCEEDED)'
321
324
  rescue GRPC::BadStatus => e
@@ -159,9 +159,10 @@ describe GRPC::ActiveCall do
159
159
  end
160
160
 
161
161
  describe '#client_invoke' do
162
- it 'sends keywords as metadata to the server when the are present' do
162
+ it 'sends metadata to the server when present' do
163
163
  call = make_test_call
164
- ActiveCall.client_invoke(call, @client_queue, k1: 'v1', k2: 'v2')
164
+ metadata = { k1: 'v1', k2: 'v2' }
165
+ ActiveCall.client_invoke(call, @client_queue, metadata)
165
166
  recvd_rpc = @server.request_call(@server_queue, @server_tag, deadline)
166
167
  recvd_call = recvd_rpc.call
167
168
  expect(recvd_call).to_not be_nil
@@ -68,15 +68,7 @@ describe 'ClientStub' do
68
68
  describe '#new' do
69
69
  let(:fake_host) { 'localhost:0' }
70
70
  it 'can be created from a host and args' do
71
- opts = { a_channel_arg: 'an_arg' }
72
- blk = proc do
73
- GRPC::ClientStub.new(fake_host, @cq, :this_channel_is_insecure, **opts)
74
- end
75
- expect(&blk).not_to raise_error
76
- end
77
-
78
- it 'can be created with a default deadline' do
79
- opts = { a_channel_arg: 'an_arg', deadline: 5 }
71
+ opts = { channel_args: { a_channel_arg: 'an_arg' } }
80
72
  blk = proc do
81
73
  GRPC::ClientStub.new(fake_host, @cq, :this_channel_is_insecure, **opts)
82
74
  end
@@ -84,7 +76,10 @@ describe 'ClientStub' do
84
76
  end
85
77
 
86
78
  it 'can be created with an channel override' do
87
- opts = { a_channel_arg: 'an_arg', channel_override: @ch }
79
+ opts = {
80
+ channel_args: { a_channel_arg: 'an_arg' },
81
+ channel_override: @ch
82
+ }
88
83
  blk = proc do
89
84
  GRPC::ClientStub.new(fake_host, @cq, :this_channel_is_insecure, **opts)
90
85
  end
@@ -93,7 +88,10 @@ describe 'ClientStub' do
93
88
 
94
89
  it 'cannot be created with a bad channel override' do
95
90
  blk = proc do
96
- opts = { a_channel_arg: 'an_arg', channel_override: Object.new }
91
+ opts = {
92
+ channel_args: { a_channel_arg: 'an_arg' },
93
+ channel_override: Object.new
94
+ }
97
95
  GRPC::ClientStub.new(fake_host, @cq, :this_channel_is_insecure, **opts)
98
96
  end
99
97
  expect(&blk).to raise_error
@@ -101,7 +99,7 @@ describe 'ClientStub' do
101
99
 
102
100
  it 'cannot be created with bad credentials' do
103
101
  blk = proc do
104
- opts = { a_channel_arg: 'an_arg' }
102
+ opts = { channel_args: { a_channel_arg: 'an_arg' } }
105
103
  GRPC::ClientStub.new(fake_host, @cq, Object.new, **opts)
106
104
  end
107
105
  expect(&blk).to raise_error
@@ -111,8 +109,10 @@ describe 'ClientStub' do
111
109
  certs = load_test_certs
112
110
  blk = proc do
113
111
  opts = {
114
- GRPC::Core::Channel::SSL_TARGET => 'foo.test.google.fr',
115
- a_channel_arg: 'an_arg'
112
+ channel_args: {
113
+ GRPC::Core::Channel::SSL_TARGET => 'foo.test.google.fr',
114
+ a_channel_arg: 'an_arg'
115
+ }
116
116
  }
117
117
  creds = GRPC::Core::ChannelCredentials.new(certs[0], nil, nil)
118
118
  GRPC::ClientStub.new(fake_host, @cq, creds, **opts)
@@ -172,7 +172,7 @@ describe 'ClientStub' do
172
172
  describe 'without a call operation' do
173
173
  def get_response(stub)
174
174
  stub.request_response(@method, @sent_msg, noop, noop,
175
- k1: 'v1', k2: 'v2')
175
+ metadata: { k1: 'v1', k2: 'v2' })
176
176
  end
177
177
 
178
178
  it_behaves_like 'request response'
@@ -181,7 +181,8 @@ describe 'ClientStub' do
181
181
  describe 'via a call operation' do
182
182
  def get_response(stub)
183
183
  op = stub.request_response(@method, @sent_msg, noop, noop,
184
- return_op: true, k1: 'v1', k2: 'v2')
184
+ return_op: true,
185
+ metadata: { k1: 'v1', k2: 'v2' })
185
186
  expect(op).to be_a(GRPC::ActiveCall::Operation)
186
187
  op.execute
187
188
  end
@@ -196,7 +197,7 @@ describe 'ClientStub' do
196
197
  server_port = create_test_server
197
198
  host = "localhost:#{server_port}"
198
199
  @stub = GRPC::ClientStub.new(host, @cq, :this_channel_is_insecure)
199
- @options = { k1: 'v1', k2: 'v2' }
200
+ @metadata = { k1: 'v1', k2: 'v2' }
200
201
  @sent_msgs = Array.new(3) { |i| 'msg_' + (i + 1).to_s }
201
202
  @resp = 'a_reply'
202
203
  end
@@ -208,7 +209,7 @@ describe 'ClientStub' do
208
209
  end
209
210
 
210
211
  it 'should send metadata to the server ok' do
211
- th = run_client_streamer(@sent_msgs, @resp, @pass, @options)
212
+ th = run_client_streamer(@sent_msgs, @resp, @pass, **@metadata)
212
213
  expect(get_response(@stub)).to eq(@resp)
213
214
  th.join
214
215
  end
@@ -221,7 +222,7 @@ describe 'ClientStub' do
221
222
  end
222
223
 
223
224
  it 'should raise ArgumentError if metadata contains invalid values' do
224
- @options.merge!(k3: 3)
225
+ @metadata.merge!(k3: 3)
225
226
  expect do
226
227
  get_response(@stub)
227
228
  end.to raise_error(ArgumentError,
@@ -231,7 +232,8 @@ describe 'ClientStub' do
231
232
 
232
233
  describe 'without a call operation' do
233
234
  def get_response(stub)
234
- stub.client_streamer(@method, @sent_msgs, noop, noop, @options)
235
+ stub.client_streamer(@method, @sent_msgs, noop, noop,
236
+ metadata: @metadata)
235
237
  end
236
238
 
237
239
  it_behaves_like 'client streaming'
@@ -240,7 +242,7 @@ describe 'ClientStub' do
240
242
  describe 'via a call operation' do
241
243
  def get_response(stub)
242
244
  op = stub.client_streamer(@method, @sent_msgs, noop, noop,
243
- @options.merge(return_op: true))
245
+ return_op: true, metadata: @metadata)
244
246
  expect(op).to be_a(GRPC::ActiveCall::Operation)
245
247
  op.execute
246
248
  end
@@ -290,7 +292,7 @@ describe 'ClientStub' do
290
292
  describe 'without a call operation' do
291
293
  def get_responses(stub)
292
294
  e = stub.server_streamer(@method, @sent_msg, noop, noop,
293
- k1: 'v1', k2: 'v2')
295
+ metadata: { k1: 'v1', k2: 'v2' })
294
296
  expect(e).to be_a(Enumerator)
295
297
  e
296
298
  end
@@ -301,7 +303,8 @@ describe 'ClientStub' do
301
303
  describe 'via a call operation' do
302
304
  def get_responses(stub)
303
305
  op = stub.server_streamer(@method, @sent_msg, noop, noop,
304
- return_op: true, k1: 'v1', k2: 'v2')
306
+ return_op: true,
307
+ metadata: { k1: 'v1', k2: 'v2' })
305
308
  expect(op).to be_a(GRPC::ActiveCall::Operation)
306
309
  e = op.execute
307
310
  expect(e).to be_a(Enumerator)
@@ -383,7 +386,7 @@ describe 'ClientStub' do
383
386
  stub = GRPC::ClientStub.new(@host, @cq, :this_channel_is_insecure)
384
387
  blk = proc do
385
388
  e = stub.bidi_streamer(@method, @sent_msgs, noop, noop,
386
- timeout: 0.001)
389
+ deadline: from_relative_time(0.001))
387
390
  e.collect { |r| r }
388
391
  end
389
392
  expect(&blk).to raise_error GRPC::BadStatus, /Deadline Exceeded/