stas        2003/11/30 13:29:49

  Modified:    perl-framework/Apache-Test/lib/Apache TestServer.pm
               perl-framework/Apache-Test Changes
  Log:
  avoid fatal errors on fetching /index.html to test whether the server
  has started, when LWP is not available
  
  Revision  Changes    Path
  1.74      +3 -4      
httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm
  
  Index: TestServer.pm
  ===================================================================
  RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -u -r1.73 -r1.74
  --- TestServer.pm     24 Nov 2003 08:28:34 -0000      1.73
  +++ TestServer.pm     30 Nov 2003 21:29:49 -0000      1.74
  @@ -584,10 +584,9 @@
   
       my $server_up = sub {
           local $SIG{__WARN__} = sub {}; #avoid "cannot connect ..." warnings
  -        if (my $r = Apache::TestRequest::GET('/index.html')) {
  -            return $r->code;
  -        }
  -        0;
  +        # avoid fatal errors when LWP is not available
  +        my $r = eval { Apache::TestRequest::GET('/index.html') };
  +        return !$@ && defined $r ? $r->code : 0;
       };
   
       if ($server_up->()) {
  
  
  
  1.69      +3 -0      httpd-test/perl-framework/Apache-Test/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -u -r1.68 -r1.69
  --- Changes   26 Nov 2003 01:11:41 -0000      1.68
  +++ Changes   30 Nov 2003 21:29:49 -0000      1.69
  @@ -8,6 +8,9 @@
   
   =item 1.07-dev
   
  +Fix Apache::TestServer::wait_till_is_up not to bail out if the server
  +takes time to start and LWP is not available. [Stas]
  +
   Fix Apache::TestConfigParse to handle glob includes, like Include
   conf/*.conf on RedHat [Philippe M. Chiasson]
   
  
  
  

Reply via email to