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
0ce7bec9
Commit
0ce7bec9
authored
9 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Fail faster
parent
57e2743b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/core/surface/concurrent_connectivity_test.c
+8
-6
8 additions, 6 deletions
test/core/surface/concurrent_connectivity_test.c
with
8 additions
and
6 deletions
test/core/surface/concurrent_connectivity_test.c
+
8
−
6
View file @
0ce7bec9
...
...
@@ -2,7 +2,9 @@
#include
<grpc/grpc.h>
#include
<grpc/support/alloc.h>
#include
<grpc/support/log.h>
#include
<grpc/support/thd.h>
#include
"test/core/util/test_config.h"
#define NUM_THREADS 100
static
grpc_channel
*
channels
[
NUM_THREADS
];
...
...
@@ -17,22 +19,22 @@ void create_loop_destroy(void* actually_an_int) {
channels
[
thread_index
]
=
chan
;
queues
[
thread_index
]
=
cq
;
gpr_timespec
inf_future
=
gpr_inf_future
(
GPR_CLOCK_REALTIME
);
gpr_timespec
delta
=
gpr_time_from_millis
(
10
,
GPR_TIMESPAN
);
for
(
int
j
=
0
;
j
<
10
;
++
j
)
{
gpr_timespec
later_time
=
gpr_time_add
(
gpr_now
(
GPR_CLOCK_REALTIME
),
delta
);
gpr_timespec
later_time
=
GRPC_TIMEOUT_MILLIS_TO_DEADLINE
(
10
);
grpc_connectivity_state
state
=
grpc_channel_check_connectivity_state
(
chan
,
1
);
grpc_channel_watch_connectivity_state
(
chan
,
state
,
later_time
,
cq
,
NULL
);
grpc_completion_queue_next
(
cq
,
inf_future
,
NULL
);
GPR_ASSERT
(
grpc_completion_queue_next
(
cq
,
GRPC_TIMEOUT_SECONDS_TO_DEADLINE
(
3
),
NULL
)
.
type
==
GRPC_OP_COMPLETE
);
}
grpc_channel_destroy
(
channels
[
thread_index
]);
grpc_completion_queue_destroy
(
queues
[
thread_index
]);
}
}
int
main
()
{
int
main
(
int
argc
,
char
**
argv
)
{
grpc_test_init
(
argc
,
argv
);
grpc_init
();
gpr_thd_id
threads
[
NUM_THREADS
];
for
(
intptr_t
i
=
0
;
i
<
NUM_THREADS
;
++
i
)
{
...
...
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