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
c6c3189f
Commit
c6c3189f
authored
9 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Add more verbose traces for debug output
parent
3bf828f6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/core/util/port_posix.c
+12
-2
12 additions, 2 deletions
test/core/util/port_posix.c
tools/run_tests/run_tests.py
+7
-3
7 additions, 3 deletions
tools/run_tests/run_tests.py
with
19 additions
and
5 deletions
test/core/util/port_posix.c
+
12
−
2
View file @
c6c3189f
...
@@ -213,15 +213,25 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg,
...
@@ -213,15 +213,25 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg,
size_t
i
;
size_t
i
;
int
port
=
0
;
int
port
=
0
;
portreq
*
pr
=
arg
;
portreq
*
pr
=
arg
;
int
failed
=
0
;
if
(
!
response
)
{
failed
=
1
;
gpr_log
(
GPR_DEBUG
,
"failed port pick from server: retrying [response=NULL]"
);
}
else
if
(
response
->
status
!=
200
)
{
failed
=
1
;
gpr_log
(
GPR_DEBUG
,
"failed port pick from server: status=%d"
,
response
->
status
);
}
if
(
!
response
||
response
->
status
!=
200
)
{
if
(
failed
)
{
grpc_httpcli_request
req
;
grpc_httpcli_request
req
;
memset
(
&
req
,
0
,
sizeof
(
req
));
memset
(
&
req
,
0
,
sizeof
(
req
));
GPR_ASSERT
(
pr
->
retries
<
10
);
GPR_ASSERT
(
pr
->
retries
<
10
);
pr
->
retries
++
;
pr
->
retries
++
;
req
.
host
=
pr
->
server
;
req
.
host
=
pr
->
server
;
req
.
path
=
"/get"
;
req
.
path
=
"/get"
;
gpr_log
(
GPR_DEBUG
,
"failed port pick from server: retrying"
);
sleep
(
1
);
sleep
(
1
);
grpc_httpcli_get
(
exec_ctx
,
pr
->
ctx
,
&
pr
->
pollset
,
&
req
,
grpc_httpcli_get
(
exec_ctx
,
pr
->
ctx
,
&
pr
->
pollset
,
&
req
,
GRPC_TIMEOUT_SECONDS_TO_DEADLINE
(
10
),
got_port_from_server
,
GRPC_TIMEOUT_SECONDS_TO_DEADLINE
(
10
),
got_port_from_server
,
...
...
This diff is collapsed.
Click to expand it.
tools/run_tests/run_tests.py
+
7
−
3
View file @
c6c3189f
...
@@ -715,17 +715,21 @@ def _start_port_server(port_server_port):
...
@@ -715,17 +715,21 @@ def _start_port_server(port_server_port):
try
:
try
:
version
=
urllib2
.
urlopen
(
'
http://localhost:%d/version
'
%
port_server_port
,
version
=
urllib2
.
urlopen
(
'
http://localhost:%d/version
'
%
port_server_port
,
timeout
=
1
).
read
()
timeout
=
1
).
read
()
print
'
detected port server running
'
running
=
True
running
=
True
except
Exception
:
except
Exception
:
print
'
failed to detect port server: %s
'
%
sys
.
exc_info
()[
0
]
running
=
False
running
=
False
if
running
:
if
running
:
with
open
(
'
tools/run_tests/port_server.py
'
)
as
f
:
with
open
(
'
tools/run_tests/port_server.py
'
)
as
f
:
current_version
=
hashlib
.
sha1
(
f
.
read
()).
hexdigest
()
current_version
=
hashlib
.
sha1
(
f
.
read
()).
hexdigest
()
running
=
(
version
==
current_version
)
running
=
(
version
==
current_version
)
if
not
running
:
if
not
running
:
print
'
port_server version mismatch: killing the old one
'
urllib2
.
urlopen
(
'
http://localhost:%d/quit
'
%
port_server_port
).
read
()
urllib2
.
urlopen
(
'
http://localhost:%d/quit
'
%
port_server_port
).
read
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
if
not
running
:
if
not
running
:
print
'
starting port_server
'
port_log
=
open
(
'
portlog.txt
'
,
'
w
'
)
port_log
=
open
(
'
portlog.txt
'
,
'
w
'
)
port_server
=
subprocess
.
Popen
(
port_server
=
subprocess
.
Popen
(
[
'
python
'
,
'
tools/run_tests/port_server.py
'
,
'
-p
'
,
'
%d
'
%
port_server_port
],
[
'
python
'
,
'
tools/run_tests/port_server.py
'
,
'
-p
'
,
'
%d
'
%
port_server_port
],
...
@@ -737,7 +741,7 @@ def _start_port_server(port_server_port):
...
@@ -737,7 +741,7 @@ def _start_port_server(port_server_port):
if
waits
>
10
:
if
waits
>
10
:
port_server
.
kill
()
port_server
.
kill
()
if
port_server
.
poll
()
is
not
None
:
if
port_server
.
poll
()
is
not
None
:
print
"
port_server failed to start
"
print
'
port_server failed to start
'
port_log
=
open
(
'
portlog.txt
'
,
'
r
'
).
read
()
port_log
=
open
(
'
portlog.txt
'
,
'
r
'
).
read
()
print
port_log
print
port_log
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
@@ -746,11 +750,11 @@ def _start_port_server(port_server_port):
...
@@ -746,11 +750,11 @@ def _start_port_server(port_server_port):
timeout
=
1
).
read
()
timeout
=
1
).
read
()
break
break
except
socket
.
timeout
:
except
socket
.
timeout
:
print
"
waiting for port_server
"
print
'
waiting for port_server
: timeout
'
time
.
sleep
(
0.5
)
time
.
sleep
(
0.5
)
waits
+=
1
waits
+=
1
except
urllib2
.
URLError
:
except
urllib2
.
URLError
:
print
"
waiting for port_server
"
print
'
waiting for port_server
: urlerror
'
time
.
sleep
(
0.5
)
time
.
sleep
(
0.5
)
waits
+=
1
waits
+=
1
except
:
except
:
...
...
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