diff lib/Test/Nginx/SMTP.pm @ 1244:575d39cc0e35

Tests: worker_shutdown_timeout within the mail module.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 20 Nov 2017 17:55:22 +0300
parents 1edb092149e2
children 29d0961bc3f7
line wrap: on
line diff
--- a/lib/Test/Nginx/SMTP.pm
+++ b/lib/Test/Nginx/SMTP.pm
@@ -10,6 +10,7 @@ use warnings;
 use strict;
 
 use Test::More qw//;
+use IO::Select;
 use IO::Socket;
 use Socket qw/ CRLF /;
 
@@ -90,6 +91,11 @@ sub authok {
 	Test::More->builder->like($self->read(), qr/^235 /, @_);
 }
 
+sub can_read {
+	my ($self, $timo) = @_;
+	IO::Select->new($self->{_socket})->can_read($timo || 3);
+}
+
 ###############################################################################
 
 sub smtp_test_daemon {