Skip to content

Instantly share code, notes, and snippets.

@ksmadsen
Created August 28, 2017 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksmadsen/a84982d57edd76cc83cfd4d4d9a98e67 to your computer and use it in GitHub Desktop.
Save ksmadsen/a84982d57edd76cc83cfd4d4d9a98e67 to your computer and use it in GitHub Desktop.
"Premature connection close" failure with Test::Mojo
use Mojo::Base;
use Mojolicious::Lite;
use Test::Mojo;
use Test::More;
get '/test' => sub { shift->render( text => "Test" ) };
my $t = Test::Mojo->new;
$t->get_ok('/test')->status_is(200);
sleep(15);
$t->get_ok('/test')->status_is(200);
done_testing();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment