|
|
|
@ -47,8 +47,6 @@ |
|
|
|
|
#include "src/core/lib/support/string.h" |
|
|
|
|
#include "test/core/end2end/cq_verifier.h" |
|
|
|
|
|
|
|
|
|
static const char *authority; |
|
|
|
|
|
|
|
|
|
enum { TIMEOUT = 200000 }; |
|
|
|
|
|
|
|
|
|
static void *tag(intptr_t t) { return (void *)t; } |
|
|
|
@ -127,7 +125,7 @@ static void end_test(grpc_end2end_test_fixture *f) { |
|
|
|
|
grpc_completion_queue_destroy(f->cq); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void simple_request_body(grpc_end2end_test_fixture f) { |
|
|
|
|
static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { |
|
|
|
|
grpc_call *c; |
|
|
|
|
grpc_call *s; |
|
|
|
|
gpr_timespec deadline = five_seconds_time(); |
|
|
|
@ -146,7 +144,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { |
|
|
|
|
char *peer; |
|
|
|
|
|
|
|
|
|
c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, |
|
|
|
|
"/foo", authority, deadline, NULL); |
|
|
|
|
"/foo", get_host_override_string("foo.test.google.fr:1234", config), deadline, NULL); |
|
|
|
|
GPR_ASSERT(c); |
|
|
|
|
|
|
|
|
|
peer = grpc_call_get_peer(c); |
|
|
|
@ -251,7 +249,7 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) { |
|
|
|
|
|
|
|
|
|
f = begin_test(config, "test_invoke_simple_request_with_no_error_logging", |
|
|
|
|
NULL, NULL); |
|
|
|
|
simple_request_body(f); |
|
|
|
|
simple_request_body(config, f); |
|
|
|
|
end_test(&f); |
|
|
|
|
config.tear_down_data(&f); |
|
|
|
|
} |
|
|
|
@ -262,10 +260,10 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { |
|
|
|
|
begin_test(config, "test_invoke_10_simple_requests_with_no_error_logging", |
|
|
|
|
NULL, NULL); |
|
|
|
|
for (i = 0; i < 10; i++) { |
|
|
|
|
simple_request_body(f); |
|
|
|
|
simple_request_body(config, f); |
|
|
|
|
gpr_log(GPR_INFO, "Passed simple request %d", i); |
|
|
|
|
} |
|
|
|
|
simple_request_body(f); |
|
|
|
|
simple_request_body(config, f); |
|
|
|
|
end_test(&f); |
|
|
|
|
config.tear_down_data(&f); |
|
|
|
|
} |
|
|
|
@ -286,17 +284,16 @@ static void test_no_logging_in_one_request(grpc_end2end_test_config config) { |
|
|
|
|
grpc_end2end_test_fixture f = |
|
|
|
|
begin_test(config, "test_no_logging_in_last_request", NULL, NULL); |
|
|
|
|
for (i = 0; i < 10; i++) { |
|
|
|
|
simple_request_body(f); |
|
|
|
|
simple_request_body(config, f); |
|
|
|
|
} |
|
|
|
|
gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)test_no_log); |
|
|
|
|
simple_request_body(f); |
|
|
|
|
simple_request_body(config, f); |
|
|
|
|
gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)gpr_default_log); |
|
|
|
|
end_test(&f); |
|
|
|
|
config.tear_down_data(&f); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void no_logging(grpc_end2end_test_config config) { |
|
|
|
|
authority = get_host_override_string("foo.test.google.fr:1234", config); |
|
|
|
|
gpr_set_log_function(log_dispatcher_func); |
|
|
|
|
test_no_logging_in_one_request(config); |
|
|
|
|
test_no_error_logging_in_entire_process(config); |
|
|
|
|