changeset 1263:ea3c7659b6c1

Tests: handled early pidfile write on win32 in the run() routine. In addition to the present waiting for pidfile, which is insufficient on win32 due to the CreateProcess model, and may lead to rare startup races, search now for the certain error message which indicates started worker process. This change allows tolerating moderate hiccups on win32 hosts.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 19 Dec 2017 19:55:01 +0300
parents b35037b3a9d0
children eb727c5ccef6
files lib/Test/Nginx.pm
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib/Test/Nginx.pm
+++ b/lib/Test/Nginx.pm
@@ -345,6 +345,12 @@ sub run(;$) {
 	$self->waitforfile("$testdir/nginx.pid", $pid)
 		or die "Can't start nginx";
 
+	for (1 .. 50) {
+		last if $^O ne 'MSWin32';
+		last if $self->read_file('error.log') =~ /create thread/;
+		select undef, undef, undef, 0.1;
+	}
+
 	$self->{_started} = 1;
 	return $self;
 }