import FCGI-ProcManager 0.15 from CPAN
[catagits/FCGI-ProcManager.git] / t / procmanager.t
index 28131c3..e4b0076 100644 (file)
@@ -5,19 +5,18 @@
 # General Public License, Version 2.1, a copy of which can be
 # found in the "COPYING" file of this distribution.
 
-# $Id: procmanager.t,v 1.4 2001/01/13 06:44:35 muaddib Exp $
+# $Id: procmanager.t,v 1.6 2001/01/31 06:57:28 muaddib Exp $
 
 use strict;
 use Test;
 
-BEGIN { plan tests => 6; }
+BEGIN { plan tests => 5; }
 
 use FCGI::ProcManager;
 
 my $m;
 
 ok $m = FCGI::ProcManager->new();
-ok $m->pm_state() eq "idle";
 
 ok $m->n_processes(100) == 100;
 ok $m->n_processes(2) == 2;
@@ -30,7 +29,7 @@ ok $m->pm_manage();
 #ok $@ =~ /dying from number of processes exception: -3/;
 #undef $@;
 
-$m->n_processes(20);
+$m->n_processes(10);
 
 #$m->pm_manage();
 #sample_request_loop($m);
@@ -42,16 +41,16 @@ sub sample_request_loop {
 
   while (1) {
     # Simulate blocking for a request.
-    my $t1 = int(rand(2)+1);
-    print "$$ waiting for $t1..\n";
+    my $t1 = int(rand(2)+2);
+    print "TEST: simulating blocking for request: $t1 seconds.\n";
     sleep $t1;
     # (Here is where accept-fail-on-intr would exit request loop.)
 
     $m->pm_pre_dispatch();
 
     # Simulate a request dispatch.
-    my $t = int(rand(3)+1);
-    print "$$ sleeping $t..\n";
+    my $t = int(rand(3)+2);
+    print "TEST: simulating new request: $t seconds.\n";
     while (my $nslept = sleep $t) {
       $t -= $nslept;
       last unless $t;