Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
another leak test
  • Loading branch information
kraih committed Jun 16, 2016
1 parent aba6466 commit 1098b87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion t/mojo/websocket_proxy.t
Expand Up @@ -195,17 +195,19 @@ ok $sent > 25, 'sent enough';

# Proxy WebSocket with bad target
$ua->proxy->http("http://127.0.0.1:$proxy");
my ($success, $err);
my ($success, $leak, $err);
$ua->websocket(
"ws://127.0.0.1:$dummy/test" => sub {
my ($ua, $tx) = @_;
$success = $tx->success;
$leak = !!Mojo::IOLoop->stream($tx->previous->connection);
$err = $tx->error;
Mojo::IOLoop->stop;
}
);
Mojo::IOLoop->start;
ok !$success, 'no success';
ok !$leak, 'connection has been removed';
is $err->{message}, 'Proxy connection failed', 'right message';

done_testing();
2 changes: 1 addition & 1 deletion t/mojo/websocket_proxy_tls.t
Expand Up @@ -271,7 +271,7 @@ $ua->websocket(
my ($ua, $tx) = @_;
$success = $tx->success;
$leak = !!Mojo::IOLoop->stream($tx->previous->connection);
$err = $tx->res->error;
$err = $tx->error;
Mojo::IOLoop->stop;
}
);
Expand Down

0 comments on commit 1098b87

Please sign in to comment.