import FCGI-ProcManager 0.15 from CPAN
[catagits/FCGI-ProcManager.git] / t / exporter.t
index 553cd31..6580997 100644 (file)
@@ -5,17 +5,15 @@
 # General Public License, Version 2.1, a copy of which can be
 # found in the "COPYING" file of this distribution.
 
-# $Id: exporter.t,v 1.1 2001/01/13 06:44:33 muaddib Exp $
+# $Id: exporter.t,v 1.3 2001/01/31 06:57:09 muaddib Exp $
 
 use strict;
 use Test;
 
-BEGIN { plan tests => 5; }
+BEGIN { plan tests => 4; }
 
 use FCGI::ProcManager qw(:all);
 
-ok pm_state() eq "idle";
-
 ok pm_parameter('n_processes',100) == 100;
 ok pm_parameter('n_processes',2) == 2;
 ok pm_parameter('n_processes',0) == 0;
@@ -27,7 +25,7 @@ ok pm_manage();
 #ok $@ =~ /dying from number of processes exception: -3/;
 #undef $@;
 
-pm_parameter('n_processes',20);
+pm_parameter('n_processes',10);
 
 #pm_manage();
 #sample_request_loop();
@@ -39,15 +37,15 @@ sub sample_request_loop {
   while (1) {
     # Simulate blocking for a request.
     my $t1 = int(rand(2)+1);
-    print "$$ waiting for $t1..\n";
+    print "TEST: simulating blocking for request: $t1 seconds.\n";
     sleep $t1;
     # (Here is where accept-fail-on-intr would exit request loop.)
 
     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 request: sleeping $t seconds.\n";
     while (my $nslept = sleep $t) {
       $t -= $nslept;
       last unless $t;