2 # Copyright (c) 2000, FundsXpress Financial Network, Inc.
3 # This library is free software released "AS IS WITH ALL FAULTS"
4 # and WITHOUT ANY WARRANTIES under the terms of the GNU Lesser
5 # General Public License, Version 2.1, a copy of which can be
6 # found in the "COPYING" file of this distribution.
8 # $Id: exporter.t,v 1.6 2001/04/23 16:13:45 muaddie Exp $
13 BEGIN { plan tests => 4; }
15 use FCGI::ProcManager qw(:all);
17 ok pm_parameter('n_processes',100) == 100;
18 ok pm_parameter('n_processes',2) == 2;
19 ok pm_parameter('n_processes',0) == 0;
23 #ok pm_parameter('n_processes',-3);
24 #eval { pm_manage(); };
25 #ok $@ =~ /dying from number of processes exception: -3/;
28 if ($ENV{PM_N_PROCESSES}) {
29 pm_parameter('n_processes',$ENV{PM_N_PROCESSES});
31 sample_request_loop();
36 sub sample_request_loop {
39 # Simulate blocking for a request.
40 my $t1 = int(rand(2)+1);
41 print "TEST: simulating blocking for request: $t1 seconds.\n";
43 # (Here is where accept-fail-on-intr would exit request loop.)
47 # Simulate a request dispatch.
48 my $t = int(rand(3)+2);
49 print "TEST: simulating request: sleeping $t seconds.\n";
50 while (my $nslept = sleep $t) {