comparison lib/Test/Nginx.pm @ 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 e35cc79ed4a1
children beed8146d045
comparison
equal deleted inserted replaced
1262:b35037b3a9d0 1263:ea3c7659b6c1
343 # wait for nginx to start 343 # wait for nginx to start
344 344
345 $self->waitforfile("$testdir/nginx.pid", $pid) 345 $self->waitforfile("$testdir/nginx.pid", $pid)
346 or die "Can't start nginx"; 346 or die "Can't start nginx";
347 347
348 for (1 .. 50) {
349 last if $^O ne 'MSWin32';
350 last if $self->read_file('error.log') =~ /create thread/;
351 select undef, undef, undef, 0.1;
352 }
353
348 $self->{_started} = 1; 354 $self->{_started} = 1;
349 return $self; 355 return $self;
350 } 356 }
351 357
352 sub port { 358 sub port {