# 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;
#ok $@ =~ /dying from number of processes exception: -3/;
#undef $@;
-$m->n_processes(20);
+$m->n_processes(10);
#$m->pm_manage();
#sample_request_loop($m);
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;