aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/tests
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-11-30 13:31:31 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-11-30 13:31:31 -0800
commite238b04c729c0469ac84bfe09164f3209ded90a4 (patch)
treeaec2cf7961cb1fad97d4ef901bb06f7bd4108f92 /test/core/end2end/tests
parentb28c7e8710638b362e5bfdd7dd81a45241c376e8 (diff)
parent71cf7b39dafdeb376370972551cbf78f2750d02e (diff)
Merge github.com:grpc/grpc into slice_with_exec_ctx
Diffstat (limited to 'test/core/end2end/tests')
-rw-r--r--test/core/end2end/tests/filter_latency.c30
-rw-r--r--test/core/end2end/tests/resource_quota_server.c2
2 files changed, 19 insertions, 13 deletions
diff --git a/test/core/end2end/tests/filter_latency.c b/test/core/end2end/tests/filter_latency.c
index 043f12dd9a..e698e38bbc 100644
--- a/test/core/end2end/tests/filter_latency.c
+++ b/test/core/end2end/tests/filter_latency.c
@@ -226,18 +226,6 @@ static void test_request(grpc_end2end_test_config config) {
grpc_call_destroy(s);
grpc_call_destroy(c);
- const gpr_timespec end_time = gpr_now(GPR_CLOCK_MONOTONIC);
- const gpr_timespec max_latency = gpr_time_sub(end_time, start_time);
-
- gpr_mu_lock(&g_mu);
- GPR_ASSERT(gpr_time_cmp(max_latency, g_client_latency) >= 0);
- GPR_ASSERT(gpr_time_cmp(gpr_time_0(GPR_TIMESPAN), g_client_latency) < 0);
- GPR_ASSERT(gpr_time_cmp(max_latency, g_server_latency) >= 0);
- GPR_ASSERT(gpr_time_cmp(gpr_time_0(GPR_TIMESPAN), g_server_latency) < 0);
- // Server latency should always be smaller than client latency.
- GPR_ASSERT(gpr_time_cmp(g_server_latency, g_client_latency) < 0);
- gpr_mu_unlock(&g_mu);
-
cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
@@ -245,6 +233,24 @@ static void test_request(grpc_end2end_test_config config) {
end_test(&f);
config.tear_down_data(&f);
+
+ const gpr_timespec end_time = gpr_now(GPR_CLOCK_MONOTONIC);
+ const gpr_timespec max_latency = gpr_time_sub(end_time, start_time);
+
+ // Perform checks after test tear-down
+ // Guards against the case that there's outstanding channel-related work on a
+ // call prior to verification
+ gpr_mu_lock(&g_mu);
+ GPR_ASSERT(gpr_time_cmp(max_latency, g_client_latency) >= 0);
+ GPR_ASSERT(gpr_time_cmp(gpr_time_0(GPR_TIMESPAN), g_client_latency) <= 0);
+ GPR_ASSERT(gpr_time_cmp(max_latency, g_server_latency) >= 0);
+ GPR_ASSERT(gpr_time_cmp(gpr_time_0(GPR_TIMESPAN), g_server_latency) <= 0);
+ // Server latency should always be smaller than client latency, however since
+ // we only calculate latency at destruction time, and that might mean that we
+ // need to wait for outstanding channel-related work, this isn't verifiable
+ // right now (the server MAY hold on to the call for longer than the client).
+ // GPR_ASSERT(gpr_time_cmp(g_server_latency, g_client_latency) < 0);
+ gpr_mu_unlock(&g_mu);
}
/*******************************************************************************
diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c
index 7ec33e97a3..c919faea89 100644
--- a/test/core/end2end/tests/resource_quota_server.c
+++ b/test/core/end2end/tests/resource_quota_server.c
@@ -234,7 +234,7 @@ void resource_quota_server(grpc_end2end_test_config config) {
while (pending_client_calls + pending_server_recv_calls +
pending_server_end_calls >
0) {
- grpc_event ev = grpc_completion_queue_next(f.cq, n_seconds_time(10), NULL);
+ grpc_event ev = grpc_completion_queue_next(f.cq, n_seconds_time(60), NULL);
GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
int ev_tag = (int)(intptr_t)ev.tag;