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
d3b83f46
Commit
d3b83f46
authored
8 years ago
by
David Garcia Quintas
Browse files
Options
Downloads
Patches
Plain Diff
Deflake lb_policies_test
parent
2cf4f35a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/core/client_channel/lb_policies_test.c
+15
-17
15 additions, 17 deletions
test/core/client_channel/lb_policies_test.c
with
15 additions
and
17 deletions
test/core/client_channel/lb_policies_test.c
+
15
−
17
View file @
d3b83f46
...
...
@@ -241,6 +241,8 @@ static request_sequences request_sequences_create(size_t n) {
res
.
n
=
n
;
res
.
connections
=
gpr_malloc
(
sizeof
(
*
res
.
connections
)
*
n
);
res
.
connectivity_states
=
gpr_malloc
(
sizeof
(
*
res
.
connectivity_states
)
*
n
);
memset
(
res
.
connections
,
0
,
sizeof
(
*
res
.
connections
)
*
n
);
memset
(
res
.
connectivity_states
,
0
,
sizeof
(
*
res
.
connectivity_states
)
*
n
);
return
res
;
}
...
...
@@ -782,17 +784,15 @@ static void verify_total_carnage_round_robin(const servers_fixture *f,
}
}
/*
n
o server is ever available. The
persistent state is TRANSIENT_FAILURE. May
*
also be CONNECTING if, under load, this check took too long to run and some
*
subchannel already transitioned to retrying
. */
/*
N
o server is ever available. The
re should be no READY states (or SHUTDOWN).
*
Note that all other states (IDLE, CONNECTING, TRANSIENT_FAILURE) are still
*
possible, as the policy transitions while attempting to reconnect
. */
for
(
size_t
i
=
0
;
i
<
sequences
->
n
;
i
++
)
{
const
grpc_connectivity_state
actual
=
sequences
->
connectivity_states
[
i
];
if
(
actual
!=
GRPC_CHANNEL_TRANSIENT_FAILURE
&&
actual
!=
GRPC_CHANNEL_CONNECTING
)
{
if
(
actual
==
GRPC_CHANNEL_READY
||
actual
==
GRPC_CHANNEL_SHUTDOWN
)
{
gpr_log
(
GPR_ERROR
,
"CONNECTIVITY STATUS SEQUENCE FAILURE: expected "
"GRPC_CHANNEL_TRANSIENT_FAILURE or GRPC_CHANNEL_CONNECTING, got "
"'%s' at iteration #%d"
,
"CONNECTIVITY STATUS SEQUENCE FAILURE: got unexpected state "
"'%s' at iteration #%d."
,
grpc_connectivity_state_name
(
actual
),
(
int
)
i
);
abort
();
}
...
...
@@ -841,17 +841,15 @@ static void verify_partial_carnage_round_robin(
abort
();
}
/* ... and that the last one should be
TRANSIENT_FAILURE, after
all servers
*
are
gone.
May also be CONNECTING if, under load, this check took too long
* t
o run and the subchannel already transitioned to retrying
. */
/* ... and that the last one should
n't
be
READY (or SHUTDOWN):
all servers
are
* gone.
It may be all other states (IDLE, CONNECTING, TRANSIENT_FAILURE), as
* t
he policy transitions while attempting to reconnect
. */
actual
=
sequences
->
connectivity_states
[
num_iters
-
1
];
for
(
i
=
0
;
i
<
sequences
->
n
;
i
++
)
{
if
(
actual
!=
GRPC_CHANNEL_TRANSIENT_FAILURE
&&
actual
!=
GRPC_CHANNEL_CONNECTING
)
{
if
(
actual
==
GRPC_CHANNEL_READY
||
actual
==
GRPC_CHANNEL_SHUTDOWN
)
{
gpr_log
(
GPR_ERROR
,
"CONNECTIVITY STATUS SEQUENCE FAILURE: expected "
"GRPC_CHANNEL_TRANSIENT_FAILURE or GRPC_CHANNEL_CONNECTING, got "
"'%s' at iteration #%d"
,
"CONNECTIVITY STATUS SEQUENCE FAILURE: got unexpected state "
"'%s' at iteration #%d."
,
grpc_connectivity_state_name
(
actual
),
(
int
)
i
);
abort
();
}
...
...
@@ -948,8 +946,8 @@ int main(int argc, char **argv) {
const
size_t
NUM_ITERS
=
10
;
const
size_t
NUM_SERVERS
=
4
;
grpc_test_init
(
argc
,
argv
);
grpc_init
();
grpc_test_init
(
argc
,
argv
);
grpc_tracer_set_enabled
(
"round_robin"
,
1
);
GPR_ASSERT
(
grpc_lb_policy_create
(
&
exec_ctx
,
"this-lb-policy-does-not-exist"
,
...
...
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