Replace disrespectful term

pull/25377/head
Yash Tibrewal 4 years ago
parent c8c80fd998
commit f4e55b85bc
  1. 2
      examples/python/xds/server.py
  2. 2
      src/compiler/cpp_generator.cc
  3. 4
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
  4. 8
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
  5. 2
      src/core/ext/filters/client_idle/client_idle_filter.cc
  6. 2
      src/core/ext/transport/cronet/BUILD
  7. 2
      src/core/ext/transport/cronet/transport/cronet_api_phony.cc
  8. 4
      src/core/lib/gpr/sync_windows.cc
  9. 2
      src/core/lib/gprpp/thd.h
  10. 2
      src/core/lib/iomgr/buffer_list.h
  11. 4
      src/core/lib/iomgr/cfstream_handle.cc
  12. 2
      src/core/lib/iomgr/error.h
  13. 2
      src/core/lib/iomgr/ev_apple.cc
  14. 6
      src/core/lib/iomgr/ev_epoll1_linux.cc
  15. 6
      src/core/lib/iomgr/ev_posix.cc
  16. 4
      src/core/lib/iomgr/tcp_uv.cc
  17. 2
      src/core/lib/iomgr/wakeup_fd_nospecial.cc
  18. 6
      src/cpp/server/server_cc.cc
  19. 2
      src/cpp/server/server_context.cc
  20. 2
      src/csharp/Grpc.Tools.Tests/GeneratorTest.cs
  21. 2
      src/objective-c/tests/PluginTest/imported-with-dash.proto
  22. 4
      src/objective-c/tests/PluginTest/test-dash-filename.proto
  23. 6
      src/objective-c/tests/UnitTests/APIv2Tests.m
  24. 14
      src/objective-c/tests/UnitTests/ChannelPoolTest.m
  25. 22
      src/objective-c/tests/UnitTests/ChannelTests.m
  26. 14
      src/objective-c/tests/UnitTests/GRPCClientTests.m
  27. 16
      src/objective-c/tests/UnitTests/TransportTests.m
  28. 8
      src/php/tests/generated_code/AbstractGeneratedCodeTest.php
  29. 8
      src/php/tests/unit_tests/CallCredentials2Test.php
  30. 4
      src/php/tests/unit_tests/CallCredentialsTest.php
  31. 4
      src/php/tests/unit_tests/CallInvokerTest.php
  32. 42
      src/php/tests/unit_tests/EndToEndTest.php
  33. 20
      src/php/tests/unit_tests/InterceptorTest.php
  34. 12
      src/php/tests/unit_tests/SecureEndToEndTest.php
  35. 4
      src/php/tests/unit_tests/ServerTest.php
  36. 2
      src/proto/grpc/testing/xds/v3/ads.proto
  37. 8
      src/python/grpcio_tests/tests/unit/_metadata_flags_test.py
  38. 2
      src/python/grpcio_tests/tests_aio/unit/abort_test.py
  39. 4
      src/python/grpcio_tests/tests_aio/unit/init_test.py
  40. 12
      src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py
  41. 2
      src/ruby/end2end/grpc_class_init_client.rb
  42. 2
      src/ruby/end2end/load_grpc_with_gc_stress_test.rb
  43. 2
      src/ruby/end2end/multiple_killed_watching_threads_test.rb
  44. 2
      src/ruby/ext/grpc/rb_compression_options.c
  45. 2
      src/ruby/ext/grpc/rb_enable_cpp.cc
  46. 2
      src/ruby/spec/call_spec.rb
  47. 12
      src/ruby/spec/channel_spec.rb
  48. 4
      src/ruby/spec/generic/active_call_spec.rb
  49. 2
      test/core/channel/minimal_stack_is_minimal_test.cc
  50. 8
      test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
  51. 2
      test/core/end2end/fixtures/inproc.cc
  52. 2
      test/core/end2end/inproc_callback_test.cc
  53. 2
      test/core/iomgr/fd_posix_test.cc
  54. 4
      test/core/iomgr/ios/CFStreamTests/CFStreamClientTests.mm
  55. 4
      test/core/iomgr/ios/CFStreamTests/CFStreamEndpointTests.mm
  56. 36
      test/core/iomgr/sockaddr_utils_test.cc
  57. 2
      test/core/iomgr/tcp_client_posix_test.cc
  58. 2
      test/core/iomgr/tcp_client_uv_test.cc
  59. 8
      test/core/security/credentials_test.cc
  60. 2
      test/core/security/etc/README
  61. 8
      test/core/transport/chttp2/context_list_test.cc
  62. 12
      test/cpp/end2end/async_end2end_test.cc
  63. 50
      test/cpp/end2end/client_callback_end2end_test.cc
  64. 126
      test/cpp/end2end/client_interceptors_end2end_test.cc
  65. 26
      test/cpp/end2end/end2end_test.cc
  66. 12
      test/cpp/end2end/interceptors_util.cc
  67. 12
      test/cpp/end2end/interceptors_util.h
  68. 70
      test/cpp/end2end/server_interceptors_end2end_test.cc
  69. 8
      test/cpp/ios/CronetTests/CppCronetEnd2EndTests.mm
  70. 8
      test/cpp/ios/CronetTests/TestHelper.h
  71. 10
      test/cpp/ios/CronetTests/TestHelper.mm
  72. 34
      test/cpp/microbenchmarks/bm_call_create.cc
  73. 22
      test/cpp/microbenchmarks/bm_chttp2_transport.cc
  74. 8
      test/cpp/microbenchmarks/bm_cq.cc
  75. 18
      test/cpp/naming/resolver_component_test.cc
  76. 4
      test/cpp/qps/driver.cc
  77. 4
      test/cpp/qps/report.cc
  78. 4
      test/cpp/qps/server_sync.cc
  79. 4
      test/cpp/util/grpc_tool_test.cc
  80. 2
      test/distrib/php/distribtest.php

@ -29,7 +29,7 @@ from grpc_health.v1 import health
from grpc_health.v1 import health_pb2
from grpc_health.v1 import health_pb2_grpc
_DESCRIPTION = "A general purpose dummy server."
_DESCRIPTION = "A general purpose phony server."
class Greeter(helloworld_pb2_grpc.GreeterServicer):

@ -762,7 +762,7 @@ void PrintHeaderClientMethodCallbackEnd(
printer->Indent();
printer->Print("friend class Stub;\n");
printer->Print("explicit experimental_async(Stub* stub): stub_(stub) { }\n");
// include a function with a dummy use of stub_ to avoid an unused
// include a function with a phony use of stub_ to avoid an unused
// private member warning for service with no methods
printer->Print("Stub* stub() { return stub_; }\n");
printer->Print("Stub* stub_;\n");

@ -54,8 +54,8 @@ class GrpcPolledFdPosix : public GrpcPolledFd {
/* c-ares library will close the fd inside grpc_fd. This fd may be picked up
immediately by another thread, and should not be closed by the following
grpc_fd_orphan. */
int dummy_release_fd;
grpc_fd_orphan(fd_, nullptr, &dummy_release_fd, "c-ares query finished");
int phony_release_fd;
grpc_fd_orphan(fd_, nullptr, &phony_release_fd, "c-ares query finished");
}
void RegisterForOnReadableLocked(grpc_closure* read_closure) override {

@ -238,14 +238,14 @@ void grpc_ares_ev_driver_shutdown_locked(grpc_ares_ev_driver* ev_driver) {
// Search fd in the fd_node list head. This is an O(n) search, the max possible
// value of n is ARES_GETSOCK_MAXNUM (16). n is typically 1 - 2 in our tests.
static fd_node* pop_fd_node_locked(fd_node** head, ares_socket_t as) {
fd_node dummy_head;
dummy_head.next = *head;
fd_node* node = &dummy_head;
fd_node phony_head;
phony_head.next = *head;
fd_node* node = &phony_head;
while (node->next != nullptr) {
if (node->next->grpc_polled_fd->GetWrappedAresSocketLocked() == as) {
fd_node* ret = node->next;
node->next = node->next->next;
*head = dummy_head.next;
*head = phony_head.next;
return ret;
}
node = node->next;

@ -187,7 +187,7 @@ void ChannelData::StartTransportOp(grpc_channel_element* elem,
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
// Catch the disconnect_with_error transport op.
if (op->disconnect_with_error != nullptr) {
// IncreaseCallCount() introduces a dummy call and prevent the timer from
// IncreaseCallCount() introduces a phony call and prevent the timer from
// being reset by other threads.
chand->IncreaseCallCount();
// If the timer has been set, cancel the timer.

@ -33,7 +33,7 @@ grpc_cc_library(
name = "grpc_transport_cronet_client_secure",
srcs = [
"client/secure/cronet_channel_create.cc",
"transport/cronet_api_dummy.cc",
"transport/cronet_api_phony.cc",
"transport/cronet_status.cc",
"transport/cronet_status.h",
"transport/cronet_transport.cc",

@ -30,7 +30,7 @@ library, so we can build it in all environments */
#ifdef GRPC_COMPILE_WITH_CRONET
/* link with the real CRONET library in the build system */
#else
/* Dummy implementation of cronet API just to test for build-ability */
/* Phony implementation of cronet API just to test for build-ability */
bidirectional_stream* bidirectional_stream_create(
stream_engine* /*engine*/, void* /*annotation*/,
bidirectional_stream_callback* /*callback*/) {

@ -100,7 +100,7 @@ void gpr_cv_broadcast(gpr_cv* cv) { WakeAllConditionVariable(cv); }
/*----------------------------------------*/
static void* dummy;
static void* phony;
struct run_once_func_arg {
void (*init_function)(void);
};
@ -113,7 +113,7 @@ static BOOL CALLBACK run_once_func(gpr_once* once, void* v, void** pv) {
void gpr_once_init(gpr_once* once, void (*init_function)(void)) {
struct run_once_func_arg arg;
arg.init_function = init_function;
InitOnceExecuteOnce(once, run_once_func, &arg, &dummy);
InitOnceExecuteOnce(once, run_once_func, &arg, &phony);
}
#endif /* defined(GPR_WINDOWS) && !defined(GPR_ABSEIL_SYNC) && \

@ -157,7 +157,7 @@ class Thread {
Thread& operator=(const Thread&) = delete;
/// The thread states are as follows:
/// FAKE -- just a dummy placeholder Thread created by the default constructor
/// FAKE -- just a phony placeholder Thread created by the default constructor
/// ALIVE -- an actual thread of control exists associated with this thread
/// STARTED -- the thread of control has been started
/// DONE -- the thread of control has completed and been joined

@ -146,7 +146,7 @@ class TracedBuffer {
#else /* GRPC_LINUX_ERRQUEUE */
class TracedBuffer {
public:
/* Dummy shutdown function */
/* Phony shutdown function */
static void Shutdown(grpc_core::TracedBuffer** /*head*/, void* /*remaining*/,
grpc_error* shutdown_err) {
GRPC_ERROR_UNREF(shutdown_err);

@ -202,9 +202,9 @@ void CFStreamHandle::Unref(const char* file, int line, const char* reason) {
#else
/* Creating a dummy function so that the grpc_cfstream library will be
/* Creating a phony function so that the grpc_cfstream library will be
* non-empty.
*/
void CFStreamDummy() {}
void CFStreamPhony() {}
#endif

@ -219,7 +219,7 @@ static grpc_error* grpc_error_create_from_vector(const char* file, int line,
grpc_error* grpc_error_set_int(grpc_error* src, grpc_error_ints which,
intptr_t value) GRPC_MUST_USE_RESULT;
/// It is an error to pass nullptr as `p`. Caller should allocate a dummy
/// It is an error to pass nullptr as `p`. Caller should allocate a phony
/// intptr_t for `p`, even if the value of `p` is not used.
bool grpc_error_get_int(grpc_error* error, grpc_error_ints which, intptr_t* p);
/// This call takes ownership of the slice; the error is responsible for

@ -20,7 +20,7 @@
/// is enabled (see iomgr_posix_cfstream.cc), a global thread is started to
/// handle and trigger all the CFStream events. The CFStream streams register
/// themselves with the run loop with functions grpc_apple_register_read_stream
/// and grpc_apple_register_read_stream. Pollsets are dummy and block on a
/// and grpc_apple_register_read_stream. Pollsets are phony and block on a
/// condition variable in pollset_work().
#include <grpc/support/port_platform.h>

@ -388,9 +388,9 @@ static void fd_shutdown_internal(grpc_fd* fd, grpc_error* why,
if (!releasing_fd) {
shutdown(fd->fd, SHUT_RDWR);
} else {
/* we need a dummy event for earlier linux versions. */
epoll_event dummy_event;
if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_DEL, fd->fd, &dummy_event) !=
/* we need a phony event for earlier linux versions. */
epoll_event phony_event;
if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_DEL, fd->fd, &phony_event) !=
0) {
gpr_log(GPR_ERROR, "epoll_ctl failed: %s", strerror(errno));
}

@ -89,7 +89,7 @@ namespace {
grpc_poll_function_type real_poll_function;
int dummy_poll(struct pollfd fds[], nfds_t nfds, int timeout) {
int phony_poll(struct pollfd fds[], nfds_t nfds, int timeout) {
if (timeout == 0) {
return real_poll_function(fds, nfds, 0);
} else {
@ -103,10 +103,10 @@ const grpc_event_engine_vtable* init_non_polling(bool explicit_request) {
if (!explicit_request) {
return nullptr;
}
// return the simplest engine as a dummy but also override the poller
// return the simplest engine as a phony but also override the poller
auto ret = grpc_init_poll_posix(explicit_request);
real_poll_function = grpc_poll_function;
grpc_poll_function = dummy_poll;
grpc_poll_function = phony_poll;
return ret;
}

@ -252,8 +252,8 @@ static void accept_new_connection(grpc_custom_socket* socket) {
uv_socket->accept_error = GRPC_ERROR_NONE;
uv_socket->pending_connections -= 1;
if (uv_socket->accept_error != GRPC_ERROR_NONE) {
uv_stream_t dummy_handle;
uv_accept((uv_stream_t*)uv_socket->handle, &dummy_handle);
uv_stream_t phony_handle;
uv_accept((uv_stream_t*)uv_socket->handle, &phony_handle);
uv_socket->accept_cb(socket, new_socket, error);
} else {
uv_socket_t* uv_new_socket = (uv_socket_t*)gpr_malloc(sizeof(uv_socket_t));

@ -17,7 +17,7 @@
*/
/*
* This is a dummy file to provide an invalid specialized_wakeup_fd_vtable on
* This is a phony file to provide an invalid specialized_wakeup_fd_vtable on
* systems without anything better than pipe.
*/

@ -88,7 +88,7 @@ class ShutdownTag : public internal::CompletionQueueTag {
}
};
class DummyTag : public internal::CompletionQueueTag {
class PhonyTag : public internal::CompletionQueueTag {
public:
bool FinalizeResult(void** /*tag*/, bool* /*status*/) override {
return true;
@ -497,7 +497,7 @@ class Server::SyncRequest final : public grpc::internal::CompletionQueueTag {
cq_.TryPluck(op_tag, gpr_inf_future(GPR_CLOCK_REALTIME));
/* Ensure the cq_ is shutdown */
grpc::DummyTag ignored_tag;
grpc::PhonyTag ignored_tag;
GPR_ASSERT(cq_.Pluck(&ignored_tag) == false);
}
delete this;
@ -1242,7 +1242,7 @@ void Server::ShutdownInternal(gpr_timespec deadline) {
/// The completion queue to use for server shutdown completion notification
grpc::CompletionQueue shutdown_cq;
grpc::ShutdownTag shutdown_tag; // Dummy shutdown tag
grpc::ShutdownTag shutdown_tag; // Phony shutdown tag
grpc_server_shutdown_and_notify(server_, shutdown_cq.cq(), &shutdown_tag);
shutdown_cq.Shutdown();

@ -126,7 +126,7 @@ class ServerContextBase::CompletionOp final
// Unref can delete this, so do not access anything from this afterward.
return;
}
/* Start a dummy op so that we can return the tag */
/* Start a phony op so that we can return the tag */
GPR_ASSERT(grpc_call_start_batch(call_.call(), nullptr, 0, core_cq_tag_,
nullptr) == GRPC_CALL_OK);
}

@ -32,7 +32,7 @@ namespace Grpc.Tools.Tests
public void SetUp()
{
_mockEngine = new Mock<IBuildEngine>();
_log = new TaskLoggingHelper(_mockEngine.Object, "dummy");
_log = new TaskLoggingHelper(_mockEngine.Object, "phony");
}
[TestCase("csharp")]

@ -18,5 +18,5 @@ package grpc.testing;
option objc_class_prefix = "RMT";
message TestMessageImported {
int32 dummy = 1;
int32 phony = 1;
}

@ -20,8 +20,8 @@ option objc_class_prefix = "RMT";
import "imported-with-dash.proto";
message TestMessage {
int32 dummy = 1;
int32 phony = 1;
}
service DummyService {
service PhonyService {
}

@ -430,10 +430,10 @@ static const NSTimeInterval kInvertedTimeout = 2;
const double kMargin = 0.1;
__weak XCTestExpectation *completion = [self expectationWithDescription:@"Timeout in a second."];
NSString *const kDummyAddress = [NSString stringWithFormat:@"127.0.0.1:10000"];
NSString *const kPhonyAddress = [NSString stringWithFormat:@"127.0.0.1:10000"];
GRPCRequestOptions *requestOptions =
[[GRPCRequestOptions alloc] initWithHost:kDummyAddress
path:@"/dummy/path"
[[GRPCRequestOptions alloc] initWithHost:kPhonyAddress
path:@"/phony/path"
safety:GRPCCallSafetyDefault];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.connectMinTimeout = timeout;

@ -24,9 +24,9 @@
#define TEST_TIMEOUT 32
static NSString *kDummyHost = @"dummy.host";
static NSString *kDummyHost2 = @"dummy.host.2";
static NSString *kDummyPath = @"/dummy/path";
static NSString *kPhonyHost = @"phony.host";
static NSString *kPhonyHost2 = @"phony.host.2";
static NSString *kPhonyPath = @"/phony/path";
@interface ChannelPoolTest : XCTestCase
@ -45,10 +45,10 @@ static NSString *kDummyPath = @"/dummy/path";
GRPCMutableCallOptions *options3 = [options1 mutableCopy];
options3.transportType = GRPCTransportTypeInsecure;
GRPCPooledChannel *channel1 = [pool channelWithHost:kDummyHost callOptions:options1];
GRPCPooledChannel *channel2 = [pool channelWithHost:kDummyHost callOptions:options2];
GRPCPooledChannel *channel3 = [pool channelWithHost:kDummyHost callOptions:options3];
GRPCPooledChannel *channel4 = [pool channelWithHost:kDummyHost2 callOptions:options1];
GRPCPooledChannel *channel1 = [pool channelWithHost:kPhonyHost callOptions:options1];
GRPCPooledChannel *channel2 = [pool channelWithHost:kPhonyHost callOptions:options2];
GRPCPooledChannel *channel3 = [pool channelWithHost:kPhonyHost callOptions:options3];
GRPCPooledChannel *channel4 = [pool channelWithHost:kPhonyHost2 callOptions:options1];
XCTAssertNotNil(channel1);
XCTAssertNotNil(channel2);

@ -25,8 +25,8 @@
#import "../../GRPCClient/private/GRPCCore/GRPCCompletionQueue.h"
#import "../../GRPCClient/private/GRPCCore/GRPCWrappedCall.h"
static NSString *kDummyHost = @"dummy.host";
static NSString *kDummyPath = @"/dummy/path";
static NSString *kPhonyHost = @"phony.host";
static NSString *kPhonyPath = @"/phony/path";
@interface ChannelTests : XCTestCase
@ -40,11 +40,11 @@ static NSString *kDummyPath = @"/dummy/path";
- (void)testPooledChannelCreatingChannel {
GRPCCallOptions *options = [[GRPCCallOptions alloc] init];
GRPCChannelConfiguration *config = [[GRPCChannelConfiguration alloc] initWithHost:kDummyHost
GRPCChannelConfiguration *config = [[GRPCChannelConfiguration alloc] initWithHost:kPhonyHost
callOptions:options];
GRPCPooledChannel *channel = [[GRPCPooledChannel alloc] initWithChannelConfiguration:config];
GRPCCompletionQueue *cq = [GRPCCompletionQueue completionQueue];
GRPCWrappedCall *wrappedCall = [channel wrappedCallWithPath:kDummyPath
GRPCWrappedCall *wrappedCall = [channel wrappedCallWithPath:kPhonyPath
completionQueue:cq
callOptions:options];
XCTAssertNotNil(channel.wrappedChannel);
@ -54,7 +54,7 @@ static NSString *kDummyPath = @"/dummy/path";
- (void)testTimedDestroyChannel {
const NSTimeInterval kDestroyDelay = 1.0;
GRPCCallOptions *options = [[GRPCCallOptions alloc] init];
GRPCChannelConfiguration *config = [[GRPCChannelConfiguration alloc] initWithHost:kDummyHost
GRPCChannelConfiguration *config = [[GRPCChannelConfiguration alloc] initWithHost:kPhonyHost
callOptions:options];
GRPCPooledChannel *channel =
[[GRPCPooledChannel alloc] initWithChannelConfiguration:config destroyDelay:kDestroyDelay];
@ -62,14 +62,14 @@ static NSString *kDummyPath = @"/dummy/path";
GRPCWrappedCall *wrappedCall;
GRPCChannel *wrappedChannel;
@autoreleasepool {
wrappedCall = [channel wrappedCallWithPath:kDummyPath completionQueue:cq callOptions:options];
wrappedCall = [channel wrappedCallWithPath:kPhonyPath completionQueue:cq callOptions:options];
XCTAssertNotNil(channel.wrappedChannel);
// Unref and ref channel immediately; expect using the same raw channel.
wrappedChannel = channel.wrappedChannel;
wrappedCall = nil;
wrappedCall = [channel wrappedCallWithPath:kDummyPath completionQueue:cq callOptions:options];
wrappedCall = [channel wrappedCallWithPath:kPhonyPath completionQueue:cq callOptions:options];
XCTAssertEqual(channel.wrappedChannel, wrappedChannel);
// Unref and ref channel after destroy delay; expect a new raw channel.
@ -77,19 +77,19 @@ static NSString *kDummyPath = @"/dummy/path";
}
sleep(kDestroyDelay + 1);
XCTAssertNil(channel.wrappedChannel);
wrappedCall = [channel wrappedCallWithPath:kDummyPath completionQueue:cq callOptions:options];
wrappedCall = [channel wrappedCallWithPath:kPhonyPath completionQueue:cq callOptions:options];
XCTAssertNotEqual(channel.wrappedChannel, wrappedChannel);
}
- (void)testDisconnect {
const NSTimeInterval kDestroyDelay = 1.0;
GRPCCallOptions *options = [[GRPCCallOptions alloc] init];
GRPCChannelConfiguration *config = [[GRPCChannelConfiguration alloc] initWithHost:kDummyHost
GRPCChannelConfiguration *config = [[GRPCChannelConfiguration alloc] initWithHost:kPhonyHost
callOptions:options];
GRPCPooledChannel *channel =
[[GRPCPooledChannel alloc] initWithChannelConfiguration:config destroyDelay:kDestroyDelay];
GRPCCompletionQueue *cq = [GRPCCompletionQueue completionQueue];
GRPCWrappedCall *wrappedCall = [channel wrappedCallWithPath:kDummyPath
GRPCWrappedCall *wrappedCall = [channel wrappedCallWithPath:kPhonyPath
completionQueue:cq
callOptions:options];
XCTAssertNotNil(channel.wrappedChannel);
@ -100,7 +100,7 @@ static NSString *kDummyPath = @"/dummy/path";
// Create a new call and unref the old call; confirm that destroy of the old call does not make
// the channel disconnect, even after the destroy delay.
GRPCWrappedCall *wrappedCall2 = [channel wrappedCallWithPath:kDummyPath
GRPCWrappedCall *wrappedCall2 = [channel wrappedCallWithPath:kPhonyPath
completionQueue:cq
callOptions:options];
XCTAssertNotNil(channel.wrappedChannel);

@ -532,11 +532,11 @@ static GRPCProtoMethod *kFullDuplexCallMethod;
- (void)testErrorCode {
int port = [self findFreePort];
NSString *const kDummyAddress = [NSString stringWithFormat:@"localhost:%d", port];
NSString *const kPhonyAddress = [NSString stringWithFormat:@"localhost:%d", port];
__weak XCTestExpectation *completion =
[self expectationWithDescription:@"Received correct error code."];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kDummyAddress
GRPCCall *call = [[GRPCCall alloc] initWithHost:kPhonyAddress
path:kEmptyCallMethod.HTTPPath
requestsWriter:[GRXWriter writerWithValue:[NSData data]]];
@ -561,14 +561,14 @@ static GRPCProtoMethod *kFullDuplexCallMethod;
const double kMargin = 0.1;
__weak XCTestExpectation *completion = [self expectationWithDescription:@"Timeout in a second."];
NSString *const kDummyAddress = [NSString stringWithFormat:@"8.8.8.8:1"];
[GRPCCall useInsecureConnectionsForHost:kDummyAddress];
NSString *const kPhonyAddress = [NSString stringWithFormat:@"8.8.8.8:1"];
[GRPCCall useInsecureConnectionsForHost:kPhonyAddress];
[GRPCCall setMinConnectTimeout:timeout * 1000
initialBackoff:backoff * 1000
maxBackoff:0
forHost:kDummyAddress];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kDummyAddress
path:@"/dummyPath"
forHost:kPhonyAddress];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kPhonyAddress
path:@"/phonyPath"
requestsWriter:[GRXWriter writerWithValue:[NSData data]]];
NSDate *startTime = [NSDate date];
id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc]

@ -68,13 +68,13 @@ static GRPCFakeTransportFactory *fakeTransportFactory;
@end
@interface DummyInterceptor : GRPCInterceptor
@interface PhonyInterceptor : GRPCInterceptor
@property(atomic) BOOL hit;
@end
@implementation DummyInterceptor {
@implementation PhonyInterceptor {
GRPCInterceptorManager *_manager;
BOOL _passthrough;
}
@ -114,15 +114,15 @@ static GRPCFakeTransportFactory *fakeTransportFactory;
@end
@interface DummyInterceptorFactory : NSObject <GRPCInterceptorFactory>
@interface PhonyInterceptorFactory : NSObject <GRPCInterceptorFactory>
- (instancetype)initWithPassthrough:(BOOL)passthrough;
@property(nonatomic, readonly) DummyInterceptor *lastInterceptor;
@property(nonatomic, readonly) PhonyInterceptor *lastInterceptor;
@end
@implementation DummyInterceptorFactory {
@implementation PhonyInterceptorFactory {
BOOL _passthrough;
}
@ -134,7 +134,7 @@ static GRPCFakeTransportFactory *fakeTransportFactory;
}
- (GRPCInterceptor *)createInterceptorWithManager:(GRPCInterceptorManager *)interceptorManager {
_lastInterceptor = [[DummyInterceptor alloc]
_lastInterceptor = [[PhonyInterceptor alloc]
initWithInterceptorManager:interceptorManager
dispatchQueue:dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL)
passthrough:_passthrough];
@ -214,8 +214,8 @@ static GRPCFakeTransportFactory *fakeTransportFactory;
[self expectationWithDescription:@"Expect call complete"];
[GRPCFakeTransportFactory sharedInstance].nextTransportInstance = nil;
DummyInterceptorFactory *factory = [[DummyInterceptorFactory alloc] initWithPassthrough:YES];
DummyInterceptorFactory *factory2 = [[DummyInterceptorFactory alloc] initWithPassthrough:NO];
PhonyInterceptorFactory *factory = [[PhonyInterceptorFactory alloc] initWithPassthrough:YES];
PhonyInterceptorFactory *factory2 = [[PhonyInterceptorFactory alloc] initWithPassthrough:NO];
[[GRPCFakeTransportFactory sharedInstance]
setTransportInterceptorFactories:@[ factory, factory2 ]];
GRPCRequestOptions *requestOptions =

@ -162,7 +162,7 @@ abstract class AbstractGeneratedCodeTest extends \PHPUnit\Framework\TestCase
public function testInvalidMethodName()
{
$this->expectException(\InvalidArgumentException::class);
$invalid_client = new DummyInvalidClient('host', [
$invalid_client = new PhonyInvalidClient('host', [
'credentials' => Grpc\ChannelCredentials::createInsecure(),
]);
$div_arg = new Math\DivArgs();
@ -173,13 +173,13 @@ abstract class AbstractGeneratedCodeTest extends \PHPUnit\Framework\TestCase
{
$this->expectException(\Exception::class);
$this->expectExceptionMessage("The opts['credentials'] key is now required.");
$invalid_client = new DummyInvalidClient('host', [
$invalid_client = new PhonyInvalidClient('host', [
]);
}
public function testPrimaryUserAgentString()
{
$invalid_client = new DummyInvalidClient('host', [
$invalid_client = new PhonyInvalidClient('host', [
'credentials' => Grpc\ChannelCredentials::createInsecure(),
'grpc.primary_user_agent' => 'testUserAgent',
]);
@ -310,7 +310,7 @@ abstract class AbstractGeneratedCodeTest extends \PHPUnit\Framework\TestCase
}
}
class DummyInvalidClient extends \Grpc\BaseStub
class PhonyInvalidClient extends \Grpc\BaseStub
{
public function InvalidUnaryCall(\Math\DivArgs $argument,
$metadata = [],

@ -62,7 +62,7 @@ class CallCredentials2Test extends \PHPUnit\Framework\TestCase
$deadline = Grpc\Timeval::infFuture();
$status_text = 'xyz';
$call = new Grpc\Call($this->channel,
'/abc/dummy_method',
'/abc/phony_method',
$deadline,
$this->host_override);
@ -87,7 +87,7 @@ class CallCredentials2Test extends \PHPUnit\Framework\TestCase
$this->assertSame($metadata['k1'], ['v1']);
$this->assertSame($metadata['k2'], ['v2']);
$this->assertSame('/abc/dummy_method', $event->method);
$this->assertSame('/abc/phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
@ -132,7 +132,7 @@ class CallCredentials2Test extends \PHPUnit\Framework\TestCase
$deadline = Grpc\Timeval::infFuture();
$status_text = 'xyz';
$call = new Grpc\Call($this->channel,
'/abc/dummy_method',
'/abc/phony_method',
$deadline,
$this->host_override);
@ -164,7 +164,7 @@ class CallCredentials2Test extends \PHPUnit\Framework\TestCase
$deadline = Grpc\Timeval::infFuture();
$status_text = 'xyz';
$call = new Grpc\Call($this->channel,
'/abc/dummy_method',
'/abc/phony_method',
$deadline,
$this->host_override);

@ -68,7 +68,7 @@ class CallCredentialsTest extends \PHPUnit\Framework\TestCase
$deadline = Grpc\Timeval::infFuture();
$status_text = 'xyz';
$call = new Grpc\Call($this->channel,
'/abc/dummy_method',
'/abc/phony_method',
$deadline,
$this->host_override);
@ -89,7 +89,7 @@ class CallCredentialsTest extends \PHPUnit\Framework\TestCase
$this->assertSame($metadata['k1'], ['v1']);
$this->assertSame($metadata['k2'], ['v2']);
$this->assertSame('/abc/dummy_method', $event->method);
$this->assertSame('/abc/phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([

@ -70,7 +70,7 @@ class CallInvokerClient extends Grpc\BaseStub
$options = []
) {
return $this->_simpleRequest(
'/dummy_method',
'/phony_method',
$argument,
[],
$metadata,
@ -209,7 +209,7 @@ class CallInvokerTest extends \PHPUnit\Framework\TestCase
$unary_call = $client->UnaryCall($req);
$event = $this->server->requestCall();
$this->assertSame('/dummy_method', $event->method);
$this->assertSame('/phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
Grpc\OP_SEND_INITIAL_METADATA => [],

@ -39,7 +39,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$deadline = Grpc\Timeval::infFuture();
$status_text = 'xyz';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -51,7 +51,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($event->send_close);
$event = $this->server->requestCall();
$this->assertSame('dummy_method', $event->method);
$this->assertSame('phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
@ -88,7 +88,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$req_text = 'message_write_flags_test';
$status_text = 'xyz';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -102,7 +102,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($event->send_close);
$event = $this->server->requestCall();
$this->assertSame('dummy_method', $event->method);
$this->assertSame('phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
@ -136,7 +136,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -150,7 +150,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($event->send_message);
$event = $this->server->requestCall();
$this->assertSame('dummy_method', $event->method);
$this->assertSame('phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
@ -197,7 +197,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -216,7 +216,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -235,7 +235,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -256,7 +256,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -270,7 +270,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($event->send_message);
$event = $this->server->requestCall();
$this->assertSame('dummy_method', $event->method);
$this->assertSame('phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
@ -295,7 +295,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -309,7 +309,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($event->send_message);
$event = $this->server->requestCall();
$this->assertSame('dummy_method', $event->method);
$this->assertSame('phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
@ -334,7 +334,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -348,7 +348,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($event->send_message);
$event = $this->server->requestCall();
$this->assertSame('dummy_method', $event->method);
$this->assertSame('phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
@ -372,7 +372,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -386,7 +386,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($event->send_message);
$event = $this->server->requestCall();
$this->assertSame('dummy_method', $event->method);
$this->assertSame('phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
@ -411,7 +411,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -425,7 +425,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($event->send_message);
$event = $this->server->requestCall();
$this->assertSame('dummy_method', $event->method);
$this->assertSame('phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
@ -449,7 +449,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([
@ -466,7 +466,7 @@ class EndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline);
$event = $call->startBatch([

@ -69,7 +69,7 @@ class InterceptorClient extends Grpc\BaseStub
$options = []
) {
return $this->_simpleRequest(
'/dummy_method',
'/phony_method',
$argument,
[],
$metadata,
@ -86,7 +86,7 @@ class InterceptorClient extends Grpc\BaseStub
$metadata = [],
$options = []
) {
return $this->_clientStreamRequest('/dummy_method', [], $metadata, $options);
return $this->_clientStreamRequest('/phony_method', [], $metadata, $options);
}
}
@ -246,13 +246,13 @@ class InterceptorTest extends \PHPUnit\Framework\TestCase
$req = new SimpleRequest($req_text);
$unary_call = $client->UnaryCall($req);
$event = $this->server->requestCall();
$this->assertSame('/dummy_method', $event->method);
$this->assertSame('/phony_method', $event->method);
$this->assertSame(['interceptor_from_unary_request'], $event->metadata['foo']);
$stream_call = $client->StreamCall();
$stream_call->write($req);
$event = $this->server->requestCall();
$this->assertSame('/dummy_method', $event->method);
$this->assertSame('/phony_method', $event->method);
$this->assertSame(['interceptor_from_stream_request'], $event->metadata['foo']);
unset($unary_call);
@ -276,14 +276,14 @@ class InterceptorTest extends \PHPUnit\Framework\TestCase
$req = new SimpleRequest($req_text);
$unary_call = $client->UnaryCall($req);
$event = $this->server->requestCall();
$this->assertSame('/dummy_method', $event->method);
$this->assertSame('/phony_method', $event->method);
$this->assertSame(['interceptor_from_unary_request'], $event->metadata['foo']);
$this->assertSame(['interceptor_from_unary_request'], $event->metadata['bar']);
$stream_call = $client->StreamCall();
$stream_call->write($req);
$event = $this->server->requestCall();
$this->assertSame('/dummy_method', $event->method);
$this->assertSame('/phony_method', $event->method);
$this->assertSame(['interceptor_from_stream_request'], $event->metadata['foo']);
$this->assertSame(['interceptor_from_stream_request'], $event->metadata['bar']);
@ -302,14 +302,14 @@ class InterceptorTest extends \PHPUnit\Framework\TestCase
$req = new SimpleRequest($req_text);
$unary_call = $client->UnaryCall($req);
$event = $this->server->requestCall();
$this->assertSame('/dummy_method', $event->method);
$this->assertSame('/phony_method', $event->method);
$this->assertSame(['interceptor_from_unary_request'], $event->metadata['foo']);
$this->assertSame(['interceptor_from_unary_request'], $event->metadata['bar']);
$stream_call = $client->StreamCall();
$stream_call->write($req);
$event = $this->server->requestCall();
$this->assertSame('/dummy_method', $event->method);
$this->assertSame('/phony_method', $event->method);
$this->assertSame(['interceptor_from_stream_request'], $event->metadata['foo']);
$this->assertSame(['interceptor_from_stream_request'], $event->metadata['bar']);
@ -333,7 +333,7 @@ class InterceptorTest extends \PHPUnit\Framework\TestCase
$unary_call = $client->UnaryCall($req);
$event = $this->server->requestCall();
$this->assertSame('/dummy_method', $event->method);
$this->assertSame('/phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
Grpc\OP_SEND_INITIAL_METADATA => [],
@ -350,7 +350,7 @@ class InterceptorTest extends \PHPUnit\Framework\TestCase
$stream_call = $client->StreamCall();
$stream_call->write($req);
$event = $this->server->requestCall();
$this->assertSame('/dummy_method', $event->method);
$this->assertSame('/phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
Grpc\OP_SEND_INITIAL_METADATA => [],

@ -53,7 +53,7 @@ class SecureEndToEndTest extends \PHPUnit\Framework\TestCase
$deadline = Grpc\Timeval::infFuture();
$status_text = 'xyz';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline,
$this->host_override);
@ -66,7 +66,7 @@ class SecureEndToEndTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($event->send_close);
$event = $this->server->requestCall();
$this->assertSame('dummy_method', $event->method);
$this->assertSame('phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
@ -104,7 +104,7 @@ class SecureEndToEndTest extends \PHPUnit\Framework\TestCase
$req_text = 'message_write_flags_test';
$status_text = 'xyz';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline,
$this->host_override);
@ -119,7 +119,7 @@ class SecureEndToEndTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($event->send_close);
$event = $this->server->requestCall();
$this->assertSame('dummy_method', $event->method);
$this->assertSame('phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
@ -154,7 +154,7 @@ class SecureEndToEndTest extends \PHPUnit\Framework\TestCase
$status_text = 'status:client_server_full_response_text';
$call = new Grpc\Call($this->channel,
'dummy_method',
'phony_method',
$deadline,
$this->host_override);
@ -169,7 +169,7 @@ class SecureEndToEndTest extends \PHPUnit\Framework\TestCase
$this->assertTrue($event->send_message);
$event = $this->server->requestCall();
$this->assertSame('dummy_method', $event->method);
$this->assertSame('phony_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([

@ -61,7 +61,7 @@ class ServerTest extends \PHPUnit\Framework\TestCase
]);
$deadline = Grpc\Timeval::infFuture();
$call = new Grpc\Call($channel, 'dummy_method', $deadline);
$call = new Grpc\Call($channel, 'phony_method', $deadline);
$event = $call->startBatch([Grpc\OP_SEND_INITIAL_METADATA => [],
Grpc\OP_SEND_CLOSE_FROM_CLIENT => true,
@ -70,7 +70,7 @@ class ServerTest extends \PHPUnit\Framework\TestCase
$c = $this->server->requestCall();
$this->assertObjectHasAttribute('call', $c);
$this->assertObjectHasAttribute('method', $c);
$this->assertSame('dummy_method', $c->method);
$this->assertSame('phony_method', $c->method);
$this->assertObjectHasAttribute('host', $c);
$this->assertTrue(is_string($c->host));
$this->assertObjectHasAttribute('absolute_deadline', $c);

@ -41,5 +41,5 @@ service AggregatedDiscoveryService {
// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing
// services: https://github.com/google/protobuf/issues/4221
message AdsDummy {
message AdsPhony {
}

@ -100,8 +100,8 @@ class _GenericHandler(grpc.GenericRpcHandler):
return None
def create_dummy_channel():
"""Creating dummy channels is a workaround for retries"""
def create_phony_channel():
"""Creating phony channels is a workaround for retries"""
host, port, sock = get_socket(sock_options=(socket.SO_REUSEADDR,))
sock.close()
return grpc.insecure_channel('{}:{}'.format(host, port))
@ -188,12 +188,12 @@ class MetadataFlagsTest(unittest.TestCase):
def test_call_wait_for_ready_default(self):
for perform_call in _ALL_CALL_CASES:
with create_dummy_channel() as channel:
with create_phony_channel() as channel:
self.check_connection_does_failfast(perform_call, channel)
def test_call_wait_for_ready_disabled(self):
for perform_call in _ALL_CALL_CASES:
with create_dummy_channel() as channel:
with create_phony_channel() as channel:
self.check_connection_does_failfast(perform_call,
channel,
wait_for_ready=False)

@ -33,7 +33,7 @@ _RESPONSE = b'\x01\x01\x01'
_NUM_STREAM_RESPONSES = 5
_ABORT_CODE = grpc.StatusCode.RESOURCE_EXHAUSTED
_ABORT_DETAILS = 'Dummy error details'
_ABORT_DETAILS = 'Phony error details'
class _GenericHandler(grpc.GenericRpcHandler):

@ -19,12 +19,12 @@ class TestInit(unittest.TestCase):
def test_grpc(self):
import grpc # pylint: disable=wrong-import-position
channel = grpc.aio.insecure_channel('dummy')
channel = grpc.aio.insecure_channel('phony')
self.assertIsInstance(channel, grpc.aio.Channel)
def test_grpc_dot_aio(self):
import grpc.aio # pylint: disable=wrong-import-position
channel = grpc.aio.insecure_channel('dummy')
channel = grpc.aio.insecure_channel('phony')
self.assertIsInstance(channel, grpc.aio.Channel)

@ -42,11 +42,11 @@ class TestWaitForConnection(AioTestBase):
async def setUp(self):
address, self._server = await start_test_server()
self._channel = aio.insecure_channel(address)
self._dummy_channel = aio.insecure_channel(UNREACHABLE_TARGET)
self._phony_channel = aio.insecure_channel(UNREACHABLE_TARGET)
self._stub = test_pb2_grpc.TestServiceStub(self._channel)
async def tearDown(self):
await self._dummy_channel.close()
await self._phony_channel.close()
await self._channel.close()
await self._server.stop(None)
@ -122,7 +122,7 @@ class TestWaitForConnection(AioTestBase):
self.assertEqual(grpc.StatusCode.OK, await call.code())
async def test_unary_unary_error(self):
call = self._dummy_channel.unary_unary(_TEST_METHOD)(_REQUEST)
call = self._phony_channel.unary_unary(_TEST_METHOD)(_REQUEST)
with self.assertRaises(aio.AioRpcError) as exception_context:
await call.wait_for_connection()
@ -130,7 +130,7 @@ class TestWaitForConnection(AioTestBase):
self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
async def test_unary_stream_error(self):
call = self._dummy_channel.unary_stream(_TEST_METHOD)(_REQUEST)
call = self._phony_channel.unary_stream(_TEST_METHOD)(_REQUEST)
with self.assertRaises(aio.AioRpcError) as exception_context:
await call.wait_for_connection()
@ -138,7 +138,7 @@ class TestWaitForConnection(AioTestBase):
self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
async def test_stream_unary_error(self):
call = self._dummy_channel.stream_unary(_TEST_METHOD)()
call = self._phony_channel.stream_unary(_TEST_METHOD)()
with self.assertRaises(aio.AioRpcError) as exception_context:
await call.wait_for_connection()
@ -146,7 +146,7 @@ class TestWaitForConnection(AioTestBase):
self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
async def test_stream_stream_error(self):
call = self._dummy_channel.stream_stream(_TEST_METHOD)()
call = self._phony_channel.stream_stream(_TEST_METHOD)()
with self.assertRaises(aio.AioRpcError) as exception_context:
await call.wait_for_connection()

@ -70,7 +70,7 @@ def get_test_proc(grpc_class)
case grpc_class
when 'channel'
return proc do
GRPC::Core::Channel.new('dummy_host', nil, :this_channel_is_insecure)
GRPC::Core::Channel.new('phony_host', nil, :this_channel_is_insecure)
end
when 'server'
return proc do

@ -25,7 +25,7 @@ GC.stress = 0x04
require 'grpc'
GRPC::Core::Channel.new('dummy_host', nil, :this_channel_is_insecure)
GRPC::Core::Channel.new('phony_host', nil, :this_channel_is_insecure)
GRPC::Core::Server.new({})
GRPC::Core::ChannelCredentials.new
GRPC::Core::CallCredentials.new(proc { |noop| noop })

@ -35,7 +35,7 @@ end
def run_multiple_killed_watches(num_threads, sleep_time)
channels = []
num_threads.times do
ch = GRPC::Core::Channel.new('dummy_host',
ch = GRPC::Core::Channel.new('phony_host',
nil, :this_channel_is_insecure)
watch_state(ch, sleep_time)
channels << ch

@ -142,7 +142,7 @@ grpc_compression_level grpc_rb_compression_options_level_name_to_value_internal(
"Unrecognized compression level name."
"Valid compression level names are none, low, medium, and high.");
/* Dummy return statement. */
/* Phony return statement. */
return GRPC_COMPRESS_LEVEL_NONE;
}

@ -18,5 +18,5 @@
#include <ruby/ruby.h>
// This is a dummy C++ source file to trigger ruby extension builder to
// This is a phony C++ source file to trigger ruby extension builder to
// pick C++ rather than C linker to link with c++ library properly.

@ -171,7 +171,7 @@ describe GRPC::Core::Call do
end
def make_test_call
@ch.create_call(nil, nil, 'dummy_method', nil, deadline)
@ch.create_call(nil, nil, 'phony_method', nil, deadline)
end
def deadline

@ -53,7 +53,7 @@ describe GRPC::Core::Channel do
shared_examples '#new' do
it 'take a host name without channel args' do
blk = proc do
GRPC::Core::Channel.new('dummy_host', nil, :this_channel_is_insecure)
GRPC::Core::Channel.new('phony_host', nil, :this_channel_is_insecure)
end
expect(&blk).not_to raise_error
end
@ -114,7 +114,7 @@ describe GRPC::Core::Channel do
describe '#new for secure channels' do
def construct_with_args(a)
proc { GRPC::Core::Channel.new('dummy_host', a, create_test_cert) }
proc { GRPC::Core::Channel.new('phony_host', a, create_test_cert) }
end
it_behaves_like '#new'
@ -125,7 +125,7 @@ describe GRPC::Core::Channel do
def construct_with_args(a)
proc do
GRPC::Core::Channel.new('dummy_host', a, :this_channel_is_insecure)
GRPC::Core::Channel.new('phony_host', a, :this_channel_is_insecure)
end
end
end
@ -137,7 +137,7 @@ describe GRPC::Core::Channel do
deadline = Time.now + 5
blk = proc do
ch.create_call(nil, nil, 'dummy_method', nil, deadline)
ch.create_call(nil, nil, 'phony_method', nil, deadline)
end
expect(&blk).to_not raise_error
end
@ -148,7 +148,7 @@ describe GRPC::Core::Channel do
deadline = Time.now + 5
blk = proc do
ch.create_call(nil, nil, 'dummy_method', nil, deadline)
ch.create_call(nil, nil, 'phony_method', nil, deadline)
end
expect(&blk).to raise_error(RuntimeError)
end
@ -160,7 +160,7 @@ describe GRPC::Core::Channel do
blk = proc do
fork_with_propagated_error_message do
ch.create_call(nil, nil, 'dummy_method', nil, deadline)
ch.create_call(nil, nil, 'phony_method', nil, deadline)
end
end
expect(&blk).to raise_error(RuntimeError, 'grpc cannot be used before and after forking')

@ -198,11 +198,11 @@ describe GRPC::ActiveCall do
deadline,
started: false)
metadata = { key: 'dummy_val', other: 'other_val' }
metadata = { key: 'phony_val', other: 'other_val' }
expect(@client_call.metadata_sent).to eq(false)
@client_call.merge_metadata_to_send(metadata)
message = 'dummy message'
message = 'phony message'
expect(call).to(
receive(:run_batch)

@ -123,7 +123,7 @@ int main(int argc, char** argv) {
static int check_stack(const char* file, int line, const char* transport_name,
grpc_channel_args* init_args,
unsigned channel_stack_type, ...) {
// create dummy channel stack
// create phony channel stack
grpc_channel_stack_builder* builder = grpc_channel_stack_builder_create();
grpc_transport_vtable fake_transport_vtable;
memset(&fake_transport_vtable, 0, sizeof(grpc_transport_vtable));

@ -77,10 +77,10 @@ static grpc_ares_request* my_dns_lookup_ares_locked(
} else {
gpr_mu_unlock(&g_mu);
*addresses = absl::make_unique<grpc_core::ServerAddressList>();
grpc_resolved_address dummy_resolved_address;
memset(&dummy_resolved_address, 0, sizeof(dummy_resolved_address));
dummy_resolved_address.len = 123;
(*addresses)->emplace_back(dummy_resolved_address, nullptr);
grpc_resolved_address phony_resolved_address;
memset(&phony_resolved_address, 0, sizeof(phony_resolved_address));
phony_resolved_address.len = 123;
(*addresses)->emplace_back(phony_resolved_address, nullptr);
}
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, error);
return nullptr;

@ -34,7 +34,7 @@
#include "test/core/util/test_config.h"
typedef struct inproc_fixture_data {
bool dummy; // reserved for future expansion. Struct can't be empty
bool phony; // reserved for future expansion. Struct can't be empty
} inproc_fixture_data;
static grpc_end2end_test_fixture inproc_create_fixture(

@ -32,7 +32,7 @@
#include "test/core/util/test_config.h"
typedef struct inproc_fixture_data {
bool dummy; // reserved for future expansion. Struct can't be empty
bool phony; // reserved for future expansion. Struct can't be empty
} inproc_fixture_data;
namespace {

@ -81,7 +81,7 @@ static void create_test_socket(int port, int* socket_fd,
sin->sin_port = htons(static_cast<uint16_t>(port));
}
/* Dummy gRPC callback */
/* Phony gRPC callback */
void no_op_cb(void* /*arg*/, int /*success*/) {}
/* =======An upload server to test notify_on_read===========

@ -90,7 +90,7 @@ static void must_fail(void* arg, grpc_error* error) {
resolved_addr.len = sizeof(struct sockaddr_in);
addr->sin_family = AF_INET;
/* create a dummy server */
/* create a phony server */
svr_fd = socket(AF_INET, SOCK_STREAM, 0);
GPR_ASSERT(svr_fd >= 0);
GPR_ASSERT(0 == bind(svr_fd, (struct sockaddr*)addr, (socklen_t)resolved_addr.len));
@ -181,7 +181,7 @@ static void must_fail(void* arg, grpc_error* error) {
#else // GRPC_CFSTREAM
// Dummy test suite
// Phony test suite
@interface CFStreamClientTests : XCTestCase
@end

@ -116,7 +116,7 @@ static bool compare_slice_buffer_with_buffer(grpc_slice_buffer *slices, const ch
resolved_addr.len = sizeof(struct sockaddr_in);
addr->sin_family = AF_INET;
/* create a dummy server */
/* create a phony server */
svr_fd = socket(AF_INET, SOCK_STREAM, 0);
XCTAssertGreaterThanOrEqual(svr_fd, 0);
XCTAssertEqual(bind(svr_fd, (struct sockaddr *)addr, (socklen_t)resolved_addr.len), 0);
@ -326,7 +326,7 @@ static bool compare_slice_buffer_with_buffer(grpc_slice_buffer *slices, const ch
#else // GRPC_CFSTREAM
// Dummy test suite
// Phony test suite
@interface CFStreamEndpointTests : XCTestCase
@end

@ -130,7 +130,7 @@ static void test_sockaddr_is_wildcard(void) {
grpc_resolved_address wild4;
grpc_resolved_address wild6;
grpc_resolved_address wild_mapped;
grpc_resolved_address dummy;
grpc_resolved_address phony;
grpc_sockaddr_in* wild4_addr;
grpc_sockaddr_in6* wild6_addr;
grpc_sockaddr_in6* wild_mapped_addr;
@ -168,8 +168,8 @@ static void test_sockaddr_is_wildcard(void) {
/* Test AF_UNSPEC. */
port = -1;
memset(&dummy, 0, sizeof(dummy));
GPR_ASSERT(!grpc_sockaddr_is_wildcard(&dummy, &port));
memset(&phony, 0, sizeof(phony));
GPR_ASSERT(!grpc_sockaddr_is_wildcard(&phony, &port));
GPR_ASSERT(port == -1);
}
@ -190,8 +190,8 @@ static void expect_sockaddr_uri(const char* expected,
static void test_sockaddr_to_string(void) {
grpc_resolved_address input4;
grpc_resolved_address input6;
grpc_resolved_address dummy;
grpc_sockaddr* dummy_addr;
grpc_resolved_address phony;
grpc_sockaddr* phony_addr;
gpr_log(GPR_INFO, "%s", "test_sockaddr_to_string");
@ -227,19 +227,19 @@ static void test_sockaddr_to_string(void) {
expect_sockaddr_str("[::fffe:c000:263]:12345", &input6, 1);
expect_sockaddr_uri("ipv6:[::fffe:c000:263]:12345", &input6);
memset(&dummy, 0, sizeof(dummy));
dummy_addr = reinterpret_cast<grpc_sockaddr*>(dummy.addr);
dummy_addr->sa_family = 123;
expect_sockaddr_str("(sockaddr family=123)", &dummy, 0);
expect_sockaddr_str("(sockaddr family=123)", &dummy, 1);
GPR_ASSERT(grpc_sockaddr_to_uri(&dummy).empty());
memset(&phony, 0, sizeof(phony));
phony_addr = reinterpret_cast<grpc_sockaddr*>(phony.addr);
phony_addr->sa_family = 123;
expect_sockaddr_str("(sockaddr family=123)", &phony, 0);
expect_sockaddr_str("(sockaddr family=123)", &phony, 1);
GPR_ASSERT(grpc_sockaddr_to_uri(&phony).empty());
}
static void test_sockaddr_set_get_port(void) {
grpc_resolved_address input4;
grpc_resolved_address input6;
grpc_resolved_address dummy;
grpc_sockaddr* dummy_addr;
grpc_resolved_address phony;
grpc_sockaddr* phony_addr;
gpr_log(GPR_DEBUG, "test_sockaddr_set_get_port");
@ -253,11 +253,11 @@ static void test_sockaddr_set_get_port(void) {
GPR_ASSERT(grpc_sockaddr_set_port(&input6, 54321));
GPR_ASSERT(grpc_sockaddr_get_port(&input6) == 54321);
memset(&dummy, 0, sizeof(dummy));
dummy_addr = reinterpret_cast<grpc_sockaddr*>(dummy.addr);
dummy_addr->sa_family = 123;
GPR_ASSERT(grpc_sockaddr_get_port(&dummy) == 0);
GPR_ASSERT(grpc_sockaddr_set_port(&dummy, 1234) == 0);
memset(&phony, 0, sizeof(phony));
phony_addr = reinterpret_cast<grpc_sockaddr*>(phony.addr);
phony_addr->sa_family = 123;
GPR_ASSERT(grpc_sockaddr_get_port(&phony) == 0);
GPR_ASSERT(grpc_sockaddr_set_port(&phony, 1234) == 0);
}
int main(int argc, char** argv) {

@ -92,7 +92,7 @@ void test_succeeds(void) {
resolved_addr.len = static_cast<socklen_t>(sizeof(struct sockaddr_in));
addr->sin_family = AF_INET;
/* create a dummy server */
/* create a phony server */
svr_fd = socket(AF_INET, SOCK_STREAM, 0);
GPR_ASSERT(svr_fd >= 0);
GPR_ASSERT(

@ -95,7 +95,7 @@ void test_succeeds(void) {
resolved_addr.len = sizeof(struct sockaddr_in);
addr->sin_family = AF_INET;
/* create a dummy server */
/* create a phony server */
GPR_ASSERT(0 == uv_tcp_init(uv_default_loop(), svr_handle));
GPR_ASSERT(0 == uv_tcp_bind(svr_handle, (struct sockaddr*)addr, 0));
GPR_ASSERT(0 == uv_listen((uv_stream_t*)svr_handle, 1, connection_cb));

@ -1663,19 +1663,19 @@ struct fake_call_creds : public grpc_call_credentials {
explicit fake_call_creds() : grpc_call_credentials("fake") {
grpc_slice key = grpc_slice_from_static_string("foo");
grpc_slice value = grpc_slice_from_static_string("oof");
dummy_md_ = grpc_mdelem_from_slices(key, value);
phony_md_ = grpc_mdelem_from_slices(key, value);
grpc_slice_unref(key);
grpc_slice_unref(value);
}
~fake_call_creds() override { GRPC_MDELEM_UNREF(dummy_md_); }
~fake_call_creds() override { GRPC_MDELEM_UNREF(phony_md_); }
bool get_request_metadata(grpc_polling_entity* /*pollent*/,
grpc_auth_metadata_context /*context*/,
grpc_credentials_mdelem_array* md_array,
grpc_closure* /*on_request_metadata*/,
grpc_error** /*error*/) override {
grpc_credentials_mdelem_array_add(md_array, dummy_md_);
grpc_credentials_mdelem_array_add(md_array, phony_md_);
return true;
}
@ -1683,7 +1683,7 @@ struct fake_call_creds : public grpc_call_credentials {
grpc_error* /*error*/) override {}
private:
grpc_mdelem dummy_md_;
grpc_mdelem phony_md_;
};
static void test_google_default_creds_not_default(void) {

@ -1,2 +1,2 @@
These files are manual copies of a pem cert from the /etc/ssl/certs/ directory.
They serve only as dummy certificate test files.
They serve only as phony certificate test files.

@ -36,7 +36,7 @@ namespace {
const uint32_t kByteOffset = 123;
void* DummyArgsCopier(void* arg) { return arg; }
void* PhonyArgsCopier(void* arg) { return arg; }
void TestExecuteFlushesListVerifier(void* arg, grpc_core::Timestamps* ts,
grpc_error* error) {
@ -55,7 +55,7 @@ class ContextListTest : public ::testing::Test {
protected:
void SetUp() override {
grpc_http2_set_write_timestamps_callback(TestExecuteFlushesListVerifier);
grpc_http2_set_fn_get_copied_context(DummyArgsCopier);
grpc_http2_set_fn_get_copied_context(PhonyArgsCopier);
}
};
@ -68,7 +68,7 @@ TEST_F(ContextListTest, ExecuteFlushesList) {
const int kNumElems = 5;
grpc_core::ExecCtx exec_ctx;
grpc_stream_refcount ref;
GRPC_STREAM_REF_INIT(&ref, 1, nullptr, nullptr, "dummy ref");
GRPC_STREAM_REF_INIT(&ref, 1, nullptr, nullptr, "phony ref");
grpc_resource_quota* resource_quota =
grpc_resource_quota_create("context_list_test");
grpc_endpoint* mock_endpoint =
@ -124,7 +124,7 @@ TEST_F(ContextListTest, NonEmptyListEmptyTimestamp) {
const int kNumElems = 5;
grpc_core::ExecCtx exec_ctx;
grpc_stream_refcount ref;
GRPC_STREAM_REF_INIT(&ref, 1, nullptr, nullptr, "dummy ref");
GRPC_STREAM_REF_INIT(&ref, 1, nullptr, nullptr, "phony ref");
grpc_resource_quota* resource_quota =
grpc_resource_quota_create("context_list_test");
grpc_endpoint* mock_endpoint =

@ -1495,9 +1495,9 @@ class AsyncEnd2endServerTryCancelTest : public AsyncEnd2endTest {
EXPECT_EQ(::grpc::StatusCode::CANCELLED, recv_status.error_code());
cli_cq.Shutdown();
void* dummy_tag;
bool dummy_ok;
while (cli_cq.Next(&dummy_tag, &dummy_ok)) {
void* phony_tag;
bool phony_ok;
while (cli_cq.Next(&phony_tag, &phony_ok)) {
}
}
@ -1644,9 +1644,9 @@ class AsyncEnd2endServerTryCancelTest : public AsyncEnd2endTest {
EXPECT_EQ(::grpc::StatusCode::CANCELLED, recv_status.error_code());
cli_cq.Shutdown();
void* dummy_tag;
bool dummy_ok;
while (cli_cq.Next(&dummy_tag, &dummy_ok)) {
void* phony_tag;
bool phony_ok;
while (cli_cq.Next(&phony_tag, &phony_ok)) {
}
}

@ -120,10 +120,10 @@ class ClientCallbackEnd2endTest
std::vector<
std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>
creators;
// Add 20 dummy server interceptors
// Add 20 phony server interceptors
creators.reserve(20);
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
builder.experimental().SetInterceptorCreators(std::move(creators));
}
@ -148,7 +148,7 @@ class ClientCallbackEnd2endTest
} else {
channel_ = CreateCustomChannelWithInterceptors(
server_address_.str(), channel_creds, args,
CreateDummyClientInterceptors());
CreatePhonyClientInterceptors());
}
break;
case Protocol::INPROC:
@ -156,7 +156,7 @@ class ClientCallbackEnd2endTest
channel_ = server_->InProcessChannel(args);
} else {
channel_ = server_->experimental().InProcessChannelWithInterceptors(
args, CreateDummyClientInterceptors());
args, CreatePhonyClientInterceptors());
}
break;
default:
@ -164,7 +164,7 @@ class ClientCallbackEnd2endTest
}
stub_ = grpc::testing::EchoTestService::NewStub(channel_);
generic_stub_ = absl::make_unique<GenericStub>(channel_);
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
}
void TearDown() override {
@ -607,7 +607,7 @@ TEST_P(ClientCallbackEnd2endTest, CancelRpcBeforeStart) {
cv.wait(l);
}
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -749,7 +749,7 @@ TEST_P(ClientCallbackEnd2endTest, RequestStream) {
test.Await();
// Make sure that the server interceptors were not notified to cancel
if (GetParam().use_interceptors) {
EXPECT_EQ(0, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(0, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -760,7 +760,7 @@ TEST_P(ClientCallbackEnd2endTest, ClientCancelsRequestStream) {
test.Await();
// Make sure that the server interceptors got the cancel
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -772,7 +772,7 @@ TEST_P(ClientCallbackEnd2endTest, RequestStreamServerCancelBeforeReads) {
test.Await();
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -784,7 +784,7 @@ TEST_P(ClientCallbackEnd2endTest, RequestStreamServerCancelDuringRead) {
test.Await();
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -797,7 +797,7 @@ TEST_P(ClientCallbackEnd2endTest, RequestStreamServerCancelAfterReads) {
test.Await();
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -856,7 +856,7 @@ TEST_P(ClientCallbackEnd2endTest, UnaryReactor) {
test.Await();
// Make sure that the server interceptors were not notified of a cancel
if (GetParam().use_interceptors) {
EXPECT_EQ(0, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(0, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -922,7 +922,7 @@ TEST_P(ClientCallbackEnd2endTest, GenericUnaryReactor) {
test.Await();
// Make sure that the server interceptors were not notified of a cancel
if (GetParam().use_interceptors) {
EXPECT_EQ(0, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(0, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1033,7 +1033,7 @@ TEST_P(ClientCallbackEnd2endTest, ResponseStream) {
test.Await();
// Make sure that the server interceptors were not notified of a cancel
if (GetParam().use_interceptors) {
EXPECT_EQ(0, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(0, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1054,7 +1054,7 @@ TEST_P(ClientCallbackEnd2endTest, ResponseStreamServerCancelBefore) {
test.Await();
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1066,7 +1066,7 @@ TEST_P(ClientCallbackEnd2endTest, ResponseStreamServerCancelDuring) {
test.Await();
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1079,7 +1079,7 @@ TEST_P(ClientCallbackEnd2endTest, ResponseStreamServerCancelAfter) {
test.Await();
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1246,7 +1246,7 @@ TEST_P(ClientCallbackEnd2endTest, BidiStream) {
test.Await();
// Make sure that the server interceptors were not notified of a cancel
if (GetParam().use_interceptors) {
EXPECT_EQ(0, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(0, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1259,7 +1259,7 @@ TEST_P(ClientCallbackEnd2endTest, BidiStreamFirstWriteAsync) {
test.Await();
// Make sure that the server interceptors were not notified of a cancel
if (GetParam().use_interceptors) {
EXPECT_EQ(0, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(0, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1272,7 +1272,7 @@ TEST_P(ClientCallbackEnd2endTest, BidiStreamCorked) {
test.Await();
// Make sure that the server interceptors were not notified of a cancel
if (GetParam().use_interceptors) {
EXPECT_EQ(0, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(0, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1285,7 +1285,7 @@ TEST_P(ClientCallbackEnd2endTest, BidiStreamCorkedFirstWriteAsync) {
test.Await();
// Make sure that the server interceptors were not notified of a cancel
if (GetParam().use_interceptors) {
EXPECT_EQ(0, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(0, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1299,7 +1299,7 @@ TEST_P(ClientCallbackEnd2endTest, ClientCancelsBidiStream) {
test.Await();
// Make sure that the server interceptors were notified of a cancel
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1312,7 +1312,7 @@ TEST_P(ClientCallbackEnd2endTest, BidiStreamServerCancelBefore) {
test.Await();
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1327,7 +1327,7 @@ TEST_P(ClientCallbackEnd2endTest, BidiStreamServerCancelDuring) {
test.Await();
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1341,7 +1341,7 @@ TEST_P(ClientCallbackEnd2endTest, BidiStreamServerCancelAfter) {
test.Await();
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}

@ -826,19 +826,19 @@ class ParameterizedClientInterceptorsEnd2endTest
TEST_P(ParameterizedClientInterceptorsEnd2endTest,
ClientInterceptorLoggingTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
creators.push_back(absl::make_unique<LoggingInterceptorFactory>());
// Add 20 dummy interceptors
// Add 20 phony interceptors
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
auto channel = CreateClientChannel(std::move(creators));
SendRPC(channel);
LoggingInterceptor::VerifyCall(GetParam().rpc_type());
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
}
INSTANTIATE_TEST_SUITE_P(ParameterizedClientInterceptorsEnd2end,
@ -878,24 +878,24 @@ TEST_F(ClientInterceptorsEnd2endTest,
TEST_F(ClientInterceptorsEnd2endTest, ClientInterceptorHijackingTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
// Add 20 dummy interceptors before hijacking interceptor
// Add 20 phony interceptors before hijacking interceptor
creators.reserve(20);
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
creators.push_back(absl::make_unique<HijackingInterceptorFactory>());
// Add 20 dummy interceptors after hijacking interceptor
// Add 20 phony interceptors after hijacking interceptor
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
auto channel = experimental::CreateCustomChannelWithInterceptors(
server_address_, InsecureChannelCredentials(), args, std::move(creators));
MakeCall(channel);
// Make sure only 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure only 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
}
TEST_F(ClientInterceptorsEnd2endTest, ClientInterceptorLogThenHijackTest) {
@ -913,20 +913,20 @@ TEST_F(ClientInterceptorsEnd2endTest, ClientInterceptorLogThenHijackTest) {
TEST_F(ClientInterceptorsEnd2endTest,
ClientInterceptorHijackingMakesAnotherCallTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
// Add 5 dummy interceptors before hijacking interceptor
// Add 5 phony interceptors before hijacking interceptor
creators.reserve(5);
for (auto i = 0; i < 5; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
creators.push_back(
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>(
new HijackingInterceptorMakesAnotherCallFactory()));
// Add 7 dummy interceptors after hijacking interceptor
// Add 7 phony interceptors after hijacking interceptor
for (auto i = 0; i < 7; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
auto channel = server_->experimental().InProcessChannelWithInterceptors(
args, std::move(creators));
@ -934,7 +934,7 @@ TEST_F(ClientInterceptorsEnd2endTest,
MakeCall(channel);
// Make sure all interceptors were run once, since the hijacking interceptor
// makes an RPC on the intercepted channel
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 12);
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 12);
}
class ClientInterceptorsCallbackEnd2endTest : public ::testing::Test {
@ -959,40 +959,40 @@ class ClientInterceptorsCallbackEnd2endTest : public ::testing::Test {
TEST_F(ClientInterceptorsCallbackEnd2endTest,
ClientInterceptorLoggingTestWithCallback) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
creators.push_back(absl::make_unique<LoggingInterceptorFactory>());
// Add 20 dummy interceptors
// Add 20 phony interceptors
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
auto channel = server_->experimental().InProcessChannelWithInterceptors(
args, std::move(creators));
MakeCallbackCall(channel);
LoggingInterceptor::VerifyUnaryCall();
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
}
TEST_F(ClientInterceptorsCallbackEnd2endTest,
ClientInterceptorFactoryAllowsNullptrReturn) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
creators.push_back(absl::make_unique<LoggingInterceptorFactory>());
// Add 20 dummy interceptors and 20 null interceptors
// Add 20 phony interceptors and 20 null interceptors
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
creators.push_back(absl::make_unique<NullInterceptorFactory>());
}
auto channel = server_->experimental().InProcessChannelWithInterceptors(
args, std::move(creators));
MakeCallbackCall(channel);
LoggingInterceptor::VerifyUnaryCall();
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
}
class ClientInterceptorsStreamingEnd2endTest : public ::testing::Test {
@ -1016,38 +1016,38 @@ class ClientInterceptorsStreamingEnd2endTest : public ::testing::Test {
TEST_F(ClientInterceptorsStreamingEnd2endTest, ClientStreamingTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
creators.push_back(absl::make_unique<LoggingInterceptorFactory>());
// Add 20 dummy interceptors
// Add 20 phony interceptors
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
auto channel = experimental::CreateCustomChannelWithInterceptors(
server_address_, InsecureChannelCredentials(), args, std::move(creators));
MakeClientStreamingCall(channel);
LoggingInterceptor::VerifyClientStreamingCall();
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
}
TEST_F(ClientInterceptorsStreamingEnd2endTest, ServerStreamingTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
creators.push_back(absl::make_unique<LoggingInterceptorFactory>());
// Add 20 dummy interceptors
// Add 20 phony interceptors
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
auto channel = experimental::CreateCustomChannelWithInterceptors(
server_address_, InsecureChannelCredentials(), args, std::move(creators));
MakeServerStreamingCall(channel);
LoggingInterceptor::VerifyServerStreamingCall();
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
}
TEST_F(ClientInterceptorsStreamingEnd2endTest, ClientStreamingHijackingTest) {
@ -1080,7 +1080,7 @@ TEST_F(ClientInterceptorsStreamingEnd2endTest, ClientStreamingHijackingTest) {
TEST_F(ClientInterceptorsStreamingEnd2endTest, ServerStreamingHijackingTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
creators.push_back(
@ -1094,7 +1094,7 @@ TEST_F(ClientInterceptorsStreamingEnd2endTest, ServerStreamingHijackingTest) {
TEST_F(ClientInterceptorsStreamingEnd2endTest,
AsyncCQServerStreamingHijackingTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
creators.push_back(
@ -1107,7 +1107,7 @@ TEST_F(ClientInterceptorsStreamingEnd2endTest,
TEST_F(ClientInterceptorsStreamingEnd2endTest, BidiStreamingHijackingTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
creators.push_back(
@ -1119,20 +1119,20 @@ TEST_F(ClientInterceptorsStreamingEnd2endTest, BidiStreamingHijackingTest) {
TEST_F(ClientInterceptorsStreamingEnd2endTest, BidiStreamingTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
creators.push_back(absl::make_unique<LoggingInterceptorFactory>());
// Add 20 dummy interceptors
// Add 20 phony interceptors
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
auto channel = experimental::CreateCustomChannelWithInterceptors(
server_address_, InsecureChannelCredentials(), args, std::move(creators));
MakeBidiStreamingCall(channel);
LoggingInterceptor::VerifyBidiStreamingCall();
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
}
class ClientGlobalInterceptorEnd2endTest : public ::testing::Test {
@ -1154,26 +1154,26 @@ class ClientGlobalInterceptorEnd2endTest : public ::testing::Test {
std::unique_ptr<Server> server_;
};
TEST_F(ClientGlobalInterceptorEnd2endTest, DummyGlobalInterceptor) {
TEST_F(ClientGlobalInterceptorEnd2endTest, PhonyGlobalInterceptor) {
// We should ideally be registering a global interceptor only once per
// process, but for the purposes of testing, it should be fine to modify the
// registered global interceptor when there are no ongoing gRPC operations
DummyInterceptorFactory global_factory;
PhonyInterceptorFactory global_factory;
experimental::RegisterGlobalClientInterceptorFactory(&global_factory);
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
// Add 20 dummy interceptors
// Add 20 phony interceptors
creators.reserve(20);
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
auto channel = experimental::CreateCustomChannelWithInterceptors(
server_address_, InsecureChannelCredentials(), args, std::move(creators));
MakeCall(channel);
// Make sure all 20 dummy interceptors were run with the global interceptor
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 21);
// Make sure all 20 phony interceptors were run with the global interceptor
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 21);
experimental::TestOnlyResetGlobalClientInterceptorFactory();
}
@ -1184,20 +1184,20 @@ TEST_F(ClientGlobalInterceptorEnd2endTest, LoggingGlobalInterceptor) {
LoggingInterceptorFactory global_factory;
experimental::RegisterGlobalClientInterceptorFactory(&global_factory);
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
// Add 20 dummy interceptors
// Add 20 phony interceptors
creators.reserve(20);
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
auto channel = experimental::CreateCustomChannelWithInterceptors(
server_address_, InsecureChannelCredentials(), args, std::move(creators));
MakeCall(channel);
LoggingInterceptor::VerifyUnaryCall();
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
experimental::TestOnlyResetGlobalClientInterceptorFactory();
}
@ -1208,19 +1208,19 @@ TEST_F(ClientGlobalInterceptorEnd2endTest, HijackingGlobalInterceptor) {
HijackingInterceptorFactory global_factory;
experimental::RegisterGlobalClientInterceptorFactory(&global_factory);
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
// Add 20 dummy interceptors
// Add 20 phony interceptors
creators.reserve(20);
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
auto channel = experimental::CreateCustomChannelWithInterceptors(
server_address_, InsecureChannelCredentials(), args, std::move(creators));
MakeCall(channel);
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
experimental::TestOnlyResetGlobalClientInterceptorFactory();
}

@ -376,10 +376,10 @@ class End2endTest : public ::testing::TestWithParam<TestScenario> {
std::vector<
std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>
creators;
// Add 20 dummy server interceptors
// Add 20 phony server interceptors
creators.reserve(20);
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
builder.experimental().SetInterceptorCreators(std::move(creators));
}
@ -428,7 +428,7 @@ class End2endTest : public ::testing::TestWithParam<TestScenario> {
} else {
channel_ = CreateCustomChannelWithInterceptors(
server_address_.str(), channel_creds, args,
interceptor_creators.empty() ? CreateDummyClientInterceptors()
interceptor_creators.empty() ? CreatePhonyClientInterceptors()
: std::move(interceptor_creators));
}
} else {
@ -437,7 +437,7 @@ class End2endTest : public ::testing::TestWithParam<TestScenario> {
} else {
channel_ = server_->experimental().InProcessChannelWithInterceptors(
args, interceptor_creators.empty()
? CreateDummyClientInterceptors()
? CreatePhonyClientInterceptors()
: std::move(interceptor_creators));
}
}
@ -468,7 +468,7 @@ class End2endTest : public ::testing::TestWithParam<TestScenario> {
}
stub_ = grpc::testing::EchoTestService::NewStub(channel_);
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
}
bool do_not_test_{false};
@ -587,7 +587,7 @@ class End2endServerTryCancelTest : public End2endTest {
EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code());
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -669,7 +669,7 @@ class End2endServerTryCancelTest : public End2endTest {
EXPECT_FALSE(s.ok());
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -758,7 +758,7 @@ class End2endServerTryCancelTest : public End2endTest {
EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code());
// Make sure that the server interceptors were notified
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
};
@ -1205,7 +1205,7 @@ TEST_P(End2endTest, CancelRpcBeforeStart) {
EXPECT_EQ("", response.message());
EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code());
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1241,7 +1241,7 @@ TEST_P(End2endTest, CancelRpcAfterStart) {
EXPECT_EQ("", response.message());
EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code());
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1265,7 +1265,7 @@ TEST_P(End2endTest, ClientCancelsRequestStream) {
EXPECT_EQ(response.message(), "");
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1301,7 +1301,7 @@ TEST_P(End2endTest, ClientCancelsResponseStream) {
// who won the race.
EXPECT_GE(grpc::StatusCode::CANCELLED, s.error_code());
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}
@ -1338,7 +1338,7 @@ TEST_P(End2endTest, ClientCancelsBidi) {
Status s = stream->Finish();
EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code());
if (GetParam().use_interceptors) {
EXPECT_EQ(20, DummyInterceptor::GetNumTimesCancel());
EXPECT_EQ(20, PhonyInterceptor::GetNumTimesCancel());
}
}

@ -23,9 +23,9 @@
namespace grpc {
namespace testing {
std::atomic<int> DummyInterceptor::num_times_run_;
std::atomic<int> DummyInterceptor::num_times_run_reverse_;
std::atomic<int> DummyInterceptor::num_times_cancel_;
std::atomic<int> PhonyInterceptor::num_times_run_;
std::atomic<int> PhonyInterceptor::num_times_run_reverse_;
std::atomic<int> PhonyInterceptor::num_times_cancel_;
void MakeCall(const std::shared_ptr<Channel>& channel) {
auto stub = grpc::testing::EchoTestService::NewStub(channel);
@ -199,13 +199,13 @@ bool CheckMetadata(const std::multimap<std::string, std::string>& map,
}
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
CreateDummyClientInterceptors() {
CreatePhonyClientInterceptors() {
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
// Add 20 dummy interceptors before hijacking interceptor
// Add 20 phony interceptors before hijacking interceptor
creators.reserve(20);
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
return creators;
}

@ -29,9 +29,9 @@ namespace grpc {
namespace testing {
/* This interceptor does nothing. Just keeps a global count on the number of
* times it was invoked. */
class DummyInterceptor : public experimental::Interceptor {
class PhonyInterceptor : public experimental::Interceptor {
public:
DummyInterceptor() {}
PhonyInterceptor() {}
void Intercept(experimental::InterceptorBatchMethods* methods) override {
if (methods->QueryInterceptionHookPoint(
@ -67,18 +67,18 @@ class DummyInterceptor : public experimental::Interceptor {
static std::atomic<int> num_times_cancel_;
};
class DummyInterceptorFactory
class PhonyInterceptorFactory
: public experimental::ClientInterceptorFactoryInterface,
public experimental::ServerInterceptorFactoryInterface {
public:
experimental::Interceptor* CreateClientInterceptor(
experimental::ClientRpcInfo* /*info*/) override {
return new DummyInterceptor();
return new PhonyInterceptor();
}
experimental::Interceptor* CreateServerInterceptor(
experimental::ServerRpcInfo* /*info*/) override {
return new DummyInterceptor();
return new PhonyInterceptor();
}
};
@ -189,7 +189,7 @@ bool CheckMetadata(const std::multimap<std::string, std::string>& map,
const string& key, const string& value);
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
CreateDummyClientInterceptors();
CreatePhonyClientInterceptors();
inline void* tag(int i) { return reinterpret_cast<void*>(i); }
inline int detag(void* p) {

@ -252,9 +252,9 @@ class ServerInterceptorsEnd2endSyncUnaryTest : public ::testing::Test {
creators.push_back(
std::unique_ptr<experimental::ServerInterceptorFactoryInterface>(
new LoggingInterceptorFactory()));
// Add 20 dummy interceptor factories and null interceptor factories
// Add 20 phony interceptor factories and null interceptor factories
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
creators.push_back(absl::make_unique<NullInterceptorFactory>());
}
builder.experimental().SetInterceptorCreators(std::move(creators));
@ -267,12 +267,12 @@ class ServerInterceptorsEnd2endSyncUnaryTest : public ::testing::Test {
TEST_F(ServerInterceptorsEnd2endSyncUnaryTest, UnaryTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
auto channel =
grpc::CreateChannel(server_address_, InsecureChannelCredentials());
MakeCall(channel);
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
}
class ServerInterceptorsEnd2endSyncStreamingTest : public ::testing::Test {
@ -298,7 +298,7 @@ class ServerInterceptorsEnd2endSyncStreamingTest : public ::testing::Test {
std::unique_ptr<experimental::ServerInterceptorFactoryInterface>(
new LoggingInterceptorFactory()));
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
builder.experimental().SetInterceptorCreators(std::move(creators));
server_ = builder.BuildAndStart();
@ -310,38 +310,38 @@ class ServerInterceptorsEnd2endSyncStreamingTest : public ::testing::Test {
TEST_F(ServerInterceptorsEnd2endSyncStreamingTest, ClientStreamingTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
auto channel =
grpc::CreateChannel(server_address_, InsecureChannelCredentials());
MakeClientStreamingCall(channel);
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
}
TEST_F(ServerInterceptorsEnd2endSyncStreamingTest, ServerStreamingTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
auto channel =
grpc::CreateChannel(server_address_, InsecureChannelCredentials());
MakeServerStreamingCall(channel);
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
}
TEST_F(ServerInterceptorsEnd2endSyncStreamingTest, BidiStreamingTest) {
ChannelArguments args;
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
auto channel =
grpc::CreateChannel(server_address_, InsecureChannelCredentials());
MakeBidiStreamingCall(channel);
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
}
class ServerInterceptorsAsyncEnd2endTest : public ::testing::Test {};
TEST_F(ServerInterceptorsAsyncEnd2endTest, UnaryTest) {
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
int port = grpc_pick_unused_port_or_die();
string server_address = "localhost:" + std::to_string(port);
ServerBuilder builder;
@ -354,7 +354,7 @@ TEST_F(ServerInterceptorsAsyncEnd2endTest, UnaryTest) {
std::unique_ptr<experimental::ServerInterceptorFactoryInterface>(
new LoggingInterceptorFactory()));
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
builder.experimental().SetInterceptorCreators(std::move(creators));
auto cq = builder.AddCompletionQueue();
@ -400,8 +400,8 @@ TEST_F(ServerInterceptorsAsyncEnd2endTest, UnaryTest) {
EXPECT_TRUE(CheckMetadata(cli_ctx.GetServerTrailingMetadata(), "testkey",
"testvalue"));
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
server->Shutdown();
cq->Shutdown();
@ -413,7 +413,7 @@ TEST_F(ServerInterceptorsAsyncEnd2endTest, UnaryTest) {
}
TEST_F(ServerInterceptorsAsyncEnd2endTest, BidiStreamingTest) {
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
int port = grpc_pick_unused_port_or_die();
string server_address = "localhost:" + std::to_string(port);
ServerBuilder builder;
@ -426,7 +426,7 @@ TEST_F(ServerInterceptorsAsyncEnd2endTest, BidiStreamingTest) {
std::unique_ptr<experimental::ServerInterceptorFactoryInterface>(
new LoggingInterceptorFactory()));
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
builder.experimental().SetInterceptorCreators(std::move(creators));
auto cq = builder.AddCompletionQueue();
@ -482,8 +482,8 @@ TEST_F(ServerInterceptorsAsyncEnd2endTest, BidiStreamingTest) {
EXPECT_TRUE(CheckMetadata(cli_ctx.GetServerTrailingMetadata(), "testkey",
"testvalue"));
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
server->Shutdown();
cq->Shutdown();
@ -495,7 +495,7 @@ TEST_F(ServerInterceptorsAsyncEnd2endTest, BidiStreamingTest) {
}
TEST_F(ServerInterceptorsAsyncEnd2endTest, GenericRPCTest) {
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
int port = grpc_pick_unused_port_or_die();
string server_address = "localhost:" + std::to_string(port);
ServerBuilder builder;
@ -506,7 +506,7 @@ TEST_F(ServerInterceptorsAsyncEnd2endTest, GenericRPCTest) {
creators;
creators.reserve(20);
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
builder.experimental().SetInterceptorCreators(std::move(creators));
auto srv_cq = builder.AddCompletionQueue();
@ -588,8 +588,8 @@ TEST_F(ServerInterceptorsAsyncEnd2endTest, GenericRPCTest) {
EXPECT_TRUE(CheckMetadata(cli_ctx.GetServerTrailingMetadata(), "testkey",
"testvalue"));
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
server->Shutdown();
void* ignored_tag;
@ -602,7 +602,7 @@ TEST_F(ServerInterceptorsAsyncEnd2endTest, GenericRPCTest) {
}
TEST_F(ServerInterceptorsAsyncEnd2endTest, UnimplementedRpcTest) {
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
int port = grpc_pick_unused_port_or_die();
string server_address = "localhost:" + std::to_string(port);
ServerBuilder builder;
@ -611,7 +611,7 @@ TEST_F(ServerInterceptorsAsyncEnd2endTest, UnimplementedRpcTest) {
creators;
creators.reserve(20);
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
builder.experimental().SetInterceptorCreators(std::move(creators));
auto cq = builder.AddCompletionQueue();
@ -637,8 +637,8 @@ TEST_F(ServerInterceptorsAsyncEnd2endTest, UnimplementedRpcTest) {
EXPECT_EQ(StatusCode::UNIMPLEMENTED, recv_status.error_code());
EXPECT_EQ("", recv_status.error_message());
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
server->Shutdown();
cq->Shutdown();
@ -653,7 +653,7 @@ class ServerInterceptorsSyncUnimplementedEnd2endTest : public ::testing::Test {
};
TEST_F(ServerInterceptorsSyncUnimplementedEnd2endTest, UnimplementedRpcTest) {
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
int port = grpc_pick_unused_port_or_die();
string server_address = "localhost:" + std::to_string(port);
ServerBuilder builder;
@ -664,7 +664,7 @@ TEST_F(ServerInterceptorsSyncUnimplementedEnd2endTest, UnimplementedRpcTest) {
creators;
creators.reserve(20);
for (auto i = 0; i < 20; i++) {
creators.push_back(absl::make_unique<DummyInterceptorFactory>());
creators.push_back(absl::make_unique<PhonyInterceptorFactory>());
}
builder.experimental().SetInterceptorCreators(std::move(creators));
auto server = builder.BuildAndStart();
@ -685,8 +685,8 @@ TEST_F(ServerInterceptorsSyncUnimplementedEnd2endTest, UnimplementedRpcTest) {
EXPECT_EQ(StatusCode::UNIMPLEMENTED, recv_status.error_code());
EXPECT_EQ("", recv_status.error_message());
// Make sure all 20 dummy interceptors were run
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
// Make sure all 20 phony interceptors were run
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 20);
server->Shutdown();
grpc_recycle_unused_port(port);

@ -574,11 +574,11 @@ using grpc::ClientContext;
}
- (void)testClientInterceptor {
DummyInterceptor::Reset();
PhonyInterceptor::Reset();
std::vector<std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>> creators;
// Add 20 dummy interceptors
// Add 20 phony interceptors
for (auto i = 0; i < 20; i++) {
creators.push_back(std::unique_ptr<DummyInterceptorFactory>(new DummyInterceptorFactory()));
creators.push_back(std::unique_ptr<PhonyInterceptorFactory>(new PhonyInterceptorFactory()));
}
auto channel = [self getChannelWithInterceptors:std::move(creators)];
auto stub = EchoTestService::NewStub(channel);
@ -589,7 +589,7 @@ using grpc::ClientContext;
request.set_message("Hello");
Status s = stub->Echo(&context, request, &response);
XCTAssertTrue(s.ok());
XCTAssertEqual(DummyInterceptor::GetNumTimesRun(), 20);
XCTAssertEqual(PhonyInterceptor::GetNumTimesRun(), 20);
}
@end

@ -38,9 +38,9 @@ std::string ToString(const grpc::string_ref& r);
void configureCronet(void);
bool CheckIsLocalhost(const std::string& addr);
class DummyInterceptor : public grpc::experimental::Interceptor {
class PhonyInterceptor : public grpc::experimental::Interceptor {
public:
DummyInterceptor() {}
PhonyInterceptor() {}
virtual void Intercept(grpc::experimental::InterceptorBatchMethods* methods);
static void Reset();
static int GetNumTimesRun();
@ -50,12 +50,12 @@ class DummyInterceptor : public grpc::experimental::Interceptor {
static std::atomic<int> num_times_run_reverse_;
};
class DummyInterceptorFactory
class PhonyInterceptorFactory
: public grpc::experimental::ClientInterceptorFactoryInterface {
public:
virtual grpc::experimental::Interceptor* CreateClientInterceptor(
grpc::experimental::ClientRpcInfo* info) override {
return new DummyInterceptor();
return new PhonyInterceptor();
}
};

@ -28,8 +28,8 @@ using grpc::testing::EchoTestService;
using grpc::ServerContext;
using grpc::Status;
std::atomic<int> DummyInterceptor::num_times_run_;
std::atomic<int> DummyInterceptor::num_times_run_reverse_;
std::atomic<int> PhonyInterceptor::num_times_run_;
std::atomic<int> PhonyInterceptor::num_times_run_reverse_;
std::string ToString(const grpc::string_ref& r) { return std::string(r.data(), r.size()); }
@ -175,7 +175,7 @@ Status TestServiceImpl::BidiStream(ServerContext* context,
return Status::OK;
}
void DummyInterceptor::Intercept(grpc::experimental::InterceptorBatchMethods* methods) {
void PhonyInterceptor::Intercept(grpc::experimental::InterceptorBatchMethods* methods) {
if (methods->QueryInterceptionHookPoint(
grpc::experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) {
num_times_run_++;
@ -186,12 +186,12 @@ void DummyInterceptor::Intercept(grpc::experimental::InterceptorBatchMethods* me
methods->Proceed();
}
void DummyInterceptor::Reset() {
void PhonyInterceptor::Reset() {
num_times_run_.store(0);
num_times_run_reverse_.store(0);
}
int DummyInterceptor::GetNumTimesRun() {
int PhonyInterceptor::GetNumTimesRun() {
NSCAssert(num_times_run_.load() == num_times_run_reverse_.load(),
@"Interceptor must run same number of times in both directions");
return num_times_run_.load();

@ -343,7 +343,7 @@ struct Fixture {
const uint32_t flags = kFlags;
};
namespace dummy_filter {
namespace phony_filter {
static void StartTransportStreamOp(grpc_call_element* /*elem*/,
grpc_transport_stream_op_batch* /*op*/) {}
@ -373,7 +373,7 @@ void DestroyChannelElem(grpc_channel_element* /*elem*/) {}
void GetChannelInfo(grpc_channel_element* /*elem*/,
const grpc_channel_info* /*channel_info*/) {}
static const grpc_channel_filter dummy_filter = {StartTransportStreamOp,
static const grpc_channel_filter phony_filter = {StartTransportStreamOp,
StartTransportOp,
0,
InitCallElem,
@ -383,11 +383,11 @@ static const grpc_channel_filter dummy_filter = {StartTransportStreamOp,
InitChannelElem,
DestroyChannelElem,
GetChannelInfo,
"dummy_filter"};
"phony_filter"};
} // namespace dummy_filter
} // namespace phony_filter
namespace dummy_transport {
namespace phony_transport {
/* Memory required for a single stream element - this is allocated by upper
layers and initialized by the transport */
@ -430,15 +430,15 @@ void Destroy(grpc_transport* /*self*/) {}
/* implementation of grpc_transport_get_endpoint */
grpc_endpoint* GetEndpoint(grpc_transport* /*self*/) { return nullptr; }
static const grpc_transport_vtable dummy_transport_vtable = {
0, "dummy_http2", InitStream,
static const grpc_transport_vtable phony_transport_vtable = {
0, "phony_http2", InitStream,
SetPollset, SetPollsetSet, PerformStreamOp,
PerformOp, DestroyStream, Destroy,
GetEndpoint};
static grpc_transport dummy_transport = {&dummy_transport_vtable};
static grpc_transport phony_transport = {&phony_transport_vtable};
} // namespace dummy_transport
} // namespace phony_transport
class NoOp {
public:
@ -502,8 +502,8 @@ static void BM_IsolatedFilter(benchmark::State& state) {
filters.push_back(fixture.filter);
}
if (fixture.flags & CHECKS_NOT_LAST) {
filters.push_back(&dummy_filter::dummy_filter);
label << " #has_dummy_filter";
filters.push_back(&phony_filter::phony_filter);
label << " #has_phony_filter";
}
grpc_core::ExecCtx exec_ctx;
@ -517,7 +517,7 @@ static void BM_IsolatedFilter(benchmark::State& state) {
filters.empty() ? nullptr : &filters[0],
filters.size(), &channel_args,
fixture.flags & REQUIRES_TRANSPORT
? &dummy_transport::dummy_transport
? &phony_transport::phony_transport
: nullptr,
"CHANNEL", channel_stack)));
grpc_core::ExecCtx::Get()->Flush();
@ -565,9 +565,9 @@ static void BM_IsolatedFilter(benchmark::State& state) {
typedef Fixture<nullptr, 0> NoFilter;
BENCHMARK_TEMPLATE(BM_IsolatedFilter, NoFilter, NoOp);
typedef Fixture<&dummy_filter::dummy_filter, 0> DummyFilter;
BENCHMARK_TEMPLATE(BM_IsolatedFilter, DummyFilter, NoOp);
BENCHMARK_TEMPLATE(BM_IsolatedFilter, DummyFilter, SendEmptyMetadata);
typedef Fixture<&phony_filter::phony_filter, 0> PhonyFilter;
BENCHMARK_TEMPLATE(BM_IsolatedFilter, PhonyFilter, NoOp);
BENCHMARK_TEMPLATE(BM_IsolatedFilter, PhonyFilter, SendEmptyMetadata);
typedef Fixture<&grpc_client_channel_filter, 0> ClientChannelFilter;
BENCHMARK_TEMPLATE(BM_IsolatedFilter, ClientChannelFilter, NoOp);
typedef Fixture<&grpc_message_compress_filter, CHECKS_NOT_LAST> CompressFilter;
@ -691,8 +691,8 @@ class IsolatedCallFixture : public TrackCounters {
// call grpc_init() manually here to balance things out.
grpc_init();
grpc_channel_stack_builder* builder = grpc_channel_stack_builder_create();
grpc_channel_stack_builder_set_name(builder, "dummy");
grpc_channel_stack_builder_set_target(builder, "dummy_target");
grpc_channel_stack_builder_set_name(builder, "phony");
grpc_channel_stack_builder_set_target(builder, "phony_target");
GPR_ASSERT(grpc_channel_stack_builder_append_filter(
builder, &isolated_call_filter::isolated_call_filter, nullptr,
nullptr));

@ -41,9 +41,9 @@
// Helper classes
//
class DummyEndpoint : public grpc_endpoint {
class PhonyEndpoint : public grpc_endpoint {
public:
DummyEndpoint() {
PhonyEndpoint() {
static const grpc_endpoint_vtable my_vtable = {read,
write,
add_to_pollset,
@ -58,7 +58,7 @@ class DummyEndpoint : public grpc_endpoint {
can_track_err};
grpc_endpoint::vtable = &my_vtable;
ru_ = grpc_resource_user_create(LibraryInitializer::get().rq(),
"dummy_endpoint");
"phony_endpoint");
}
void PushInput(grpc_slice slice) {
@ -94,7 +94,7 @@ class DummyEndpoint : public grpc_endpoint {
static void read(grpc_endpoint* ep, grpc_slice_buffer* slices,
grpc_closure* cb, bool /*urgent*/) {
static_cast<DummyEndpoint*>(ep)->QueueRead(slices, cb);
static_cast<PhonyEndpoint*>(ep)->QueueRead(slices, cb);
}
static void write(grpc_endpoint* /*ep*/, grpc_slice_buffer* /*slices*/,
@ -112,18 +112,18 @@ class DummyEndpoint : public grpc_endpoint {
grpc_pollset_set* /*pollset*/) {}
static void shutdown(grpc_endpoint* ep, grpc_error* why) {
grpc_resource_user_shutdown(static_cast<DummyEndpoint*>(ep)->ru_);
grpc_resource_user_shutdown(static_cast<PhonyEndpoint*>(ep)->ru_);
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
static_cast<DummyEndpoint*>(ep)->read_cb_, why);
static_cast<PhonyEndpoint*>(ep)->read_cb_, why);
}
static void destroy(grpc_endpoint* ep) {
grpc_resource_user_unref(static_cast<DummyEndpoint*>(ep)->ru_);
delete static_cast<DummyEndpoint*>(ep);
grpc_resource_user_unref(static_cast<PhonyEndpoint*>(ep)->ru_);
delete static_cast<PhonyEndpoint*>(ep);
}
static grpc_resource_user* get_resource_user(grpc_endpoint* ep) {
return static_cast<DummyEndpoint*>(ep)->ru_;
return static_cast<PhonyEndpoint*>(ep)->ru_;
}
static absl::string_view get_peer(grpc_endpoint* /*ep*/) { return "test"; }
static absl::string_view get_local_address(grpc_endpoint* /*ep*/) {
@ -137,7 +137,7 @@ class Fixture {
public:
Fixture(const grpc::ChannelArguments& args, bool client) {
grpc_channel_args c_args = args.c_channel_args();
ep_ = new DummyEndpoint;
ep_ = new PhonyEndpoint;
t_ = grpc_create_chttp2_transport(&c_args, ep_, client);
grpc_chttp2_transport_start_reading(t_, nullptr, nullptr);
FlushExecCtx();
@ -155,7 +155,7 @@ class Fixture {
void PushInput(grpc_slice slice) { ep_->PushInput(slice); }
private:
DummyEndpoint* ep_;
PhonyEndpoint* ep_;
grpc_transport* t_;
};

@ -74,7 +74,7 @@ static void DoneWithCompletionOnHeap(void* /*arg*/,
delete completion;
}
class DummyTag final : public internal::CompletionQueueTag {
class PhonyTag final : public internal::CompletionQueueTag {
public:
bool FinalizeResult(void** /*tag*/, bool* /*status*/) override {
return true;
@ -87,10 +87,10 @@ static void BM_Pass1Cpp(benchmark::State& state) {
grpc_completion_queue* c_cq = cq.cq();
for (auto _ : state) {
grpc_cq_completion completion;
DummyTag dummy_tag;
PhonyTag phony_tag;
grpc_core::ExecCtx exec_ctx;
GPR_ASSERT(grpc_cq_begin_op(c_cq, &dummy_tag));
grpc_cq_end_op(c_cq, &dummy_tag, GRPC_ERROR_NONE, DoneWithCompletionOnStack,
GPR_ASSERT(grpc_cq_begin_op(c_cq, &phony_tag));
grpc_cq_end_op(c_cq, &phony_tag, GRPC_ERROR_NONE, DoneWithCompletionOnStack,
nullptr, &completion);
void* tag;

@ -289,11 +289,11 @@ void CheckLBPolicyResultLocked(const grpc_channel_args* channel_args,
}
#ifdef GPR_WINDOWS
void OpenAndCloseSocketsStressLoop(int dummy_port, gpr_event* done_ev) {
void OpenAndCloseSocketsStressLoop(int phony_port, gpr_event* done_ev) {
sockaddr_in6 addr;
memset(&addr, 0, sizeof(addr));
addr.sin6_family = AF_INET6;
addr.sin6_port = htons(dummy_port);
addr.sin6_port = htons(phony_port);
((char*)&addr.sin6_addr)[15] = 1;
for (;;) {
if (gpr_event_get(done_ev)) {
@ -315,7 +315,7 @@ void OpenAndCloseSocketsStressLoop(int dummy_port, gpr_event* done_ev) {
<< "Failed to set socket non-blocking";
ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) != SOCKET_ERROR)
<< "Failed to bind socket " + std::to_string(s) +
" to [::1]:" + std::to_string(dummy_port) +
" to [::1]:" + std::to_string(phony_port) +
". WSA error: " + std::to_string(WSAGetLastError());
ASSERT_TRUE(listen(s, 1) != SOCKET_ERROR)
<< "Failed to listen on socket " + std::to_string(s) +
@ -327,7 +327,7 @@ void OpenAndCloseSocketsStressLoop(int dummy_port, gpr_event* done_ev) {
for (size_t i = 0; i < sockets.size(); i++) {
gpr_log(GPR_DEBUG, "non-blocking accept then close on %d", sockets[i]);
ASSERT_TRUE(accept(sockets[i], nullptr, nullptr) == INVALID_SOCKET)
<< "Accept on dummy socket unexpectedly accepted actual connection.";
<< "Accept on phony socket unexpectedly accepted actual connection.";
ASSERT_TRUE(WSAGetLastError() == WSAEWOULDBLOCK)
<< "OpenAndCloseSocketsStressLoop accept on socket " +
std::to_string(sockets[i]) +
@ -344,7 +344,7 @@ void OpenAndCloseSocketsStressLoop(int dummy_port, gpr_event* done_ev) {
return;
}
#else
void OpenAndCloseSocketsStressLoop(int dummy_port, gpr_event* done_ev) {
void OpenAndCloseSocketsStressLoop(int phony_port, gpr_event* done_ev) {
// The goal of this loop is to catch socket
// "use after close" bugs within the c-ares resolver by acting
// like some separate thread doing I/O.
@ -359,7 +359,7 @@ void OpenAndCloseSocketsStressLoop(int dummy_port, gpr_event* done_ev) {
sockaddr_in6 addr;
memset(&addr, 0, sizeof(addr));
addr.sin6_family = AF_INET6;
addr.sin6_port = htons(dummy_port);
addr.sin6_port = htons(phony_port);
(reinterpret_cast<char*>(&addr.sin6_addr))[15] = 1;
for (;;) {
if (gpr_event_get(done_ev)) {
@ -385,7 +385,7 @@ void OpenAndCloseSocketsStressLoop(int dummy_port, gpr_event* done_ev) {
gpr_log(GPR_DEBUG, "Opened fd: %d", s);
ASSERT_TRUE(bind(s, (const sockaddr*)&addr, sizeof(addr)) == 0)
<< "Failed to bind socket " + std::to_string(s) +
" to [::1]:" + std::to_string(dummy_port) +
" to [::1]:" + std::to_string(phony_port) +
". errno: " + std::to_string(errno);
ASSERT_TRUE(listen(s, 1) == 0) << "Failed to listen on socket " +
std::to_string(s) +
@ -651,10 +651,10 @@ TEST(ResolverComponentTest, TestResolvesRelevantRecords) {
TEST(ResolverComponentTest, TestResolvesRelevantRecordsWithConcurrentFdStress) {
// Start up background stress thread
int dummy_port = grpc_pick_unused_port_or_die();
int phony_port = grpc_pick_unused_port_or_die();
gpr_event done_ev;
gpr_event_init(&done_ev);
std::thread socket_stress_thread(OpenAndCloseSocketsStressLoop, dummy_port,
std::thread socket_stress_thread(OpenAndCloseSocketsStressLoop, phony_port,
&done_ev);
// Run the resolver test
RunResolvesRelevantRecordsTest(ResultHandler::Create);

@ -664,10 +664,10 @@ bool RunQuit(
workers[i],
GetCredType(workers[i], per_worker_credential_types, credential_type),
nullptr /* call creds */, {} /* interceptor creators */));
Void dummy;
Void phony;
grpc::ClientContext ctx;
ctx.set_wait_for_ready(true);
Status s = stub->QuitWorker(&ctx, dummy, &dummy);
Status s = stub->QuitWorker(&ctx, phony, &phony);
if (!s.ok()) {
gpr_log(GPR_ERROR, "Worker %zu could not be properly quit because %s", i,
s.error_message().c_str());

@ -198,10 +198,10 @@ void JsonReporter::ReportQueriesPerCpuSec(const ScenarioResult& /*result*/) {
void RpcReporter::ReportQPS(const ScenarioResult& result) {
grpc::ClientContext context;
grpc::Status status;
Void dummy;
Void phony;
gpr_log(GPR_INFO, "RPC reporter sending scenario result to server");
status = stub_->ReportScenario(&context, result, &dummy);
status = stub_->ReportScenario(&context, result, &phony);
if (status.ok()) {
gpr_log(GPR_INFO, "RpcReporter report RPC success!");

@ -99,8 +99,8 @@ class BenchmarkServiceImpl final : public BenchmarkService::Service {
return done.load(std::memory_order_relaxed);
});
});
SimpleResponse dummy;
auto cp = ClientPull(context, stream, &dummy);
SimpleResponse phony;
auto cp = ClientPull(context, stream, &phony);
done.store(true, std::memory_order_relaxed); // can be lazy
t.join();
if (!cp.ok()) {

@ -465,12 +465,12 @@ TEST_F(GrpcToolTest, ListOneMethod) {
}
TEST_F(GrpcToolTest, TypeNotFound) {
// Test input "grpc_cli type localhost:<port> grpc.testing.DummyRequest"
// Test input "grpc_cli type localhost:<port> grpc.testing.PhonyRequest"
std::stringstream output_stream;
const std::string server_address = SetUpServer();
const char* argv[] = {"grpc_cli", "type", server_address.c_str(),
"grpc.testing.DummyRequest"};
"grpc.testing.PhonyRequest"};
EXPECT_TRUE(1 == GrpcToolMainLib(ArraySize(argv), argv, TestCliCredentials(),
std::bind(PrintStream, &output_stream,

@ -23,7 +23,7 @@ $channel = new Grpc\Channel('localhost:1000', [
$deadline = Grpc\Timeval::infFuture();
$call = new Grpc\Call($channel,
'dummy_method',
'phony_method',
$deadline);
$call->cancel();

Loading…
Cancel
Save