Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zircon
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zircon
Commits
a8fb374b
Commit
a8fb374b
authored
10 years ago
by
Michael Gray
Browse files
Options
Downloads
Patches
Plain Diff
t/lib/TestShared.pm: find e mpty ports dynamically.
Fixes RT 444665.
parent
ab07db28
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
t/lib/TestShared.pm
+18
-6
18 additions, 6 deletions
t/lib/TestShared.pm
with
18 additions
and
6 deletions
t/lib/TestShared.pm
+
18
−
6
View file @
a8fb374b
...
...
@@ -7,6 +7,7 @@ our @EXPORT_OK = qw( do_subtests have_display init_zircon_conn mkwidg endpoint_p
use
Test::
More
;
use
Try::
Tiny
;
use
Net::
EmptyPort
qw( check_port empty_port )
;
use
ConnHandler
;
...
...
@@ -80,13 +81,24 @@ sub mkwidg {
return
$M
;
}
{
my
$_port
=
55667
;
# FIXME: dangerous to choose fixed ports
sub
endpoint_pair
{
my
$base
=
'
tcp://127.0.0.1:
';
return
(
$base
.
$_port
++
,
$base
.
$_port
++
);
sub
endpoint_pair
{
my
$p1
=
empty_port
();
unless
(
$p1
)
{
fail
("
Couldn't find empty first port
");
return
;
}
my
$p2
=
$p1
;
while
(
++
$p2
)
{
if
(
$p2
>
65000
)
{
fail
("
Couldn't find empty second port
");
return
;
}
last
unless
check_port
(
$p2
);
}
note
("
Ports:
$p1
,
$p2
");
my
$base
=
'
tcp://127.0.0.1:
';
return
(
$base
.
$p1
,
$base
.
$p2
);
}
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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