Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
c02cee83
Commit
c02cee83
authored
8 years ago
by
Craig Tiller
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #8866 from ctiller/fixit5
Fix filter_latency tests
parents
38bfa15d
797bc833
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/core/end2end/tests/filter_latency.c
+18
-12
18 additions, 12 deletions
test/core/end2end/tests/filter_latency.c
with
18 additions
and
12 deletions
test/core/end2end/tests/filter_latency.c
+
18
−
12
View file @
c02cee83
...
@@ -226,18 +226,6 @@ static void test_request(grpc_end2end_test_config config) {
...
@@ -226,18 +226,6 @@ static void test_request(grpc_end2end_test_config config) {
grpc_call_destroy
(
s
);
grpc_call_destroy
(
s
);
grpc_call_destroy
(
c
);
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
);
cq_verifier_destroy
(
cqv
);
grpc_byte_buffer_destroy
(
request_payload
);
grpc_byte_buffer_destroy
(
request_payload
);
...
@@ -245,6 +233,24 @@ static void test_request(grpc_end2end_test_config config) {
...
@@ -245,6 +233,24 @@ static void test_request(grpc_end2end_test_config config) {
end_test
(
&
f
);
end_test
(
&
f
);
config
.
tear_down_data
(
&
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
);
}
}
/*******************************************************************************
/*******************************************************************************
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment