Use Net::EmptyPort directly, since we don't need any of the actual
testing stuff from Test::TCP. This also lets us control the sleep
interval and retries, so we don't have to loop ourselves as well.
Net::EmptyPort started exporting wait_port in 1.27, but doesn't have a
$VERSION of its own, so declare the author dependency on Net::TCP 1.27.
with event loops.
- lets you access a psgix.io socket, if your server supports it, for manual
handling of the client - server communication, such as for websockets.
+ - Fix waiting for the server to start in t/author/http-server.t
5.90030 - 2013-04-12
! POSSIBLE BREAKING CHANGE: Removed Regexp dispatch type from core, and put
push(@author_requires, 'CatalystX::LeakChecker', '0.05');
push(@author_requires, 'Catalyst::Devel', '1.0'); # For http server test
+push(@author_requires, 'Test::TCP', '1.27'); # ditto, ships Net::EmptyPort
author_tests('t/author');
author_requires(
use File::Path;
use FindBin;
-use Test::TCP;
+use Net::EmptyPort qw(wait_port empty_port);
use Try::Tiny;
use Plack::Builder;
sub wait_port_timeout {
my ($port, $timeout) = @_;
- # wait_port waits for 10 seconds
- for (1 .. int($timeout / 10)) { # meh, good enough.
- try { wait_port $port; 1 } and return;
- }
+ wait_port($port, 0.1, $timeout * 10) and return;
die "Server did not start within $timeout seconds";
}