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
f034e50b
Commit
f034e50b
authored
10 years ago
by
murgatroid99
Browse files
Options
Downloads
Patches
Plain Diff
Modified interop tests to handle binding to port 0
parent
7a81f053
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
src/node/interop/interop_server.js
+6
-5
6 additions, 5 deletions
src/node/interop/interop_server.js
src/node/test/interop_sanity_test.js
+5
-8
5 additions, 8 deletions
src/node/test/interop_sanity_test.js
with
11 additions
and
13 deletions
src/node/interop/interop_server.js
+
6
−
5
View file @
f034e50b
...
...
@@ -157,7 +157,8 @@ function handleHalfDuplex(call) {
* Get a server object bound to the given port
* @param {string} port Port to which to bind
* @param {boolean} tls Indicates that the bound port should use TLS
* @return {Server} Server object bound to the support
* @return {{server: Server, port: number}} Server object bound to the support,
* and port number that the server is bound to
*/
function
getServer
(
port
,
tls
)
{
// TODO(mlumish): enable TLS functionality
...
...
@@ -183,8 +184,8 @@ function getServer(port, tls) {
halfDuplexCall
:
handleHalfDuplex
}
},
options
);
server
.
bind
(
'
0.0.0.0:
'
+
port
,
tls
);
return
server
;
var
port_num
=
server
.
bind
(
'
0.0.0.0:
'
+
port
,
tls
);
return
{
server
:
server
,
port
:
port_num
}
;
}
if
(
require
.
main
===
module
)
{
...
...
@@ -192,8 +193,8 @@ if (require.main === module) {
var
argv
=
parseArgs
(
process
.
argv
,
{
string
:
[
'
port
'
,
'
use_tls
'
]
});
var
server
=
getServer
(
argv
.
port
,
argv
.
use_tls
===
'
true
'
);
server
.
start
();
var
server
_obj
=
getServer
(
argv
.
port
,
argv
.
use_tls
===
'
true
'
);
server_obj
.
server
.
start
();
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/node/test/interop_sanity_test.js
+
5
−
8
View file @
f034e50b
...
...
@@ -34,8 +34,6 @@
var
interop_server
=
require
(
'
../interop/interop_server.js
'
);
var
interop_client
=
require
(
'
../interop/interop_client.js
'
);
var
port_picker
=
require
(
'
../port_picker
'
);
var
server
;
var
port
;
...
...
@@ -44,12 +42,11 @@ var name_override = 'foo.test.google.com';
describe
(
'
Interop tests
'
,
function
()
{
before
(
function
(
done
)
{
port_picker
.
nextAvailablePort
(
function
(
addr
)
{
server
=
interop_server
.
getServer
(
addr
.
substring
(
addr
.
indexOf
(
'
:
'
)
+
1
),
true
);
server
.
listen
();
port
=
addr
;
done
();
});
var
server_obj
=
interop_server
.
getServer
(
0
,
true
);
server
=
server_obj
.
server
;
server
.
listen
();
port
=
'
localhost:
'
+
server_obj
.
port
;
done
();
});
// This depends on not using a binary stream
it
.
skip
(
'
should pass empty_unary
'
,
function
(
done
)
{
...
...
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