Mercurial > hg > nginx-tests
changeset 570:f7bc1f74970a
Tests: avoid send errors in syslog tests with mail error_log.
Use a separate mail server block for syslog parsing tests to make sure
that syslog messages are always read by the receiver on the remote side.
Otherwise, syslog message might not be sent due to a pending socket error.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 07 May 2015 14:28:44 +0300 |
parents | adbb9b5108aa |
children | 5c3946ebd867 |
files | mail_error_log.t |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mail_error_log.t +++ b/mail_error_log.t @@ -54,10 +54,16 @@ mail { error_log %%TESTDIR%%/e_debug.log debug; error_log %%TESTDIR%%/e_info.log info; - error_log syslog:server=127.0.0.1:8080 info; error_log syslog:server=127.0.0.1:8082 info; error_log stderr info; } + + server { + listen 127.0.0.1:8145; + protocol imap; + + error_log syslog:server=127.0.0.1:8080 info; + } } http { @@ -177,7 +183,7 @@ sub get_syslog { return undef; } - Test::Nginx::IMAP->new(); + Test::Nginx::IMAP->new(PeerAddr => "127.0.0.1:8145")->read(); IO::Select->new($s)->can_read(1.5); while (IO::Select->new($s)->can_read(0.1)) {