DR-Tnt
view release on metacpan or search on metacpan
lib/DR/Tnt/Test.pm view on Meta::CPAN
5758596061626364656667686970717273747576777879808182838485868788
$tb
->skip(
"tarantool $version is not found"
);
}
exit
;
}
}
sub
free_port() {
state
$busy_ports
= {};
while
( 1 ) {
my
$port
= 10000 +
int
rand
30000;
next
if
exists
$busy_ports
->{
$port
};
next
unless
IO::Socket::INET->new(
Listen
=> 5,
LocalAddr
=>
'127.0.0.1'
,
LocalPort
=>
$port
,
Proto
=>
'tcp'
,
(($^O eq
'MSWin32'
) ? () : (
ReuseAddr
=> 1)),
);
return
$busy_ports
->{
$port
} =
$port
;
}
}
sub
start_tarantool {
my
%opts
=
@_
;
$opts
{-port} = free_port;
DR::Tnt::Test::TntInstance->new(
%opts
);
}
1;
( run in 0.304 second using v1.01-cache-2.11-cpan-8d75d55dd25 )