X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fauthor%2Fhttp-server.t;h=2861c275ce9d12ae06c3ccc0830fa61005bf676f;hb=e43b00f9e441be1aed9a49532b419a6f6c7782fb;hp=ead1cad58d33c893e94ab78679c499f6c32353c2;hpb=86b73ee025f705d9f25d1970d2c438c00d9d1076;p=catagits%2FCatalyst-Runtime.git diff --git a/t/author/http-server.t b/t/author/http-server.t index ead1cad..2861c27 100644 --- a/t/author/http-server.t +++ b/t/author/http-server.t @@ -2,10 +2,11 @@ use strict; use warnings; use Test::More tests => 1; +use Test::TCP; use File::Path; use FindBin; -use Test::TCP; +use Net::EmptyPort qw(wait_port empty_port); use Try::Tiny; use Plack::Builder; @@ -96,10 +97,7 @@ if ($^O eq 'MSWin32') { 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, $timeout * 10) and return; die "Server did not start within $timeout seconds"; }