diff --git a/README.pod b/README.pod index 92a29c7..c0294b8 100644 --- a/README.pod +++ b/README.pod @@ -8,7 +8,7 @@ Test::HTTP::AnyEvent::Server - the async counterpart to Test::HTTP::Server =head1 VERSION -version 0.003 +version 0.004 =head1 SYNOPSIS diff --git a/lib/Test/HTTP/AnyEvent/Server.pm b/lib/Test/HTTP/AnyEvent/Server.pm index 674739f..a269ecb 100644 --- a/lib/Test/HTTP/AnyEvent/Server.pm +++ b/lib/Test/HTTP/AnyEvent/Server.pm @@ -268,17 +268,16 @@ sub BUILD { my $h = AnyEvent::Handle->new( fh => $wh, on_error => sub { - #my ($_h, $fatal, $msg) = @_; - my ($_h) = @_; - shutdown $_h->{fh}, 2; - $_h->destroy; + AE::log fatal => + "couldn't syswrite() to pipe: $!"; }, ); $self->set_server( $self->start_server(sub { my (undef, $address, $port) = @_; - $h->push_write(join("\t", $address, $port)); + # have to postpone so the address/port gets actually bound + AE::postpone { $h->push_write(join("\t", $address, $port)) }; }) ); diff --git a/t/02-forked.t b/t/02-forked.t index b3515c6..fbde47a 100644 --- a/t/02-forked.t +++ b/t/02-forked.t @@ -17,8 +17,8 @@ my $ua = HTTP::Tiny->new( proxy => undef, ); -my $res = $ua->get($server->uri . q(repeat/10000/asdfgh)); +my $res = $ua->get($server->uri . q(repeat/1000/asdfgh)); ok($res->{success}, q(success)); -like($res->{content}, qr{^(?:asdfgh){10000}$}x, q(content OK)); +like($res->{content}, qr{^(?:asdfgh){1000}$}x, q(content OK)); done_testing(2);