diff options
Diffstat (limited to 'TAO/performance-tests/Latency/multi_threaded.pl')
-rwxr-xr-x | TAO/performance-tests/Latency/multi_threaded.pl | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/TAO/performance-tests/Latency/multi_threaded.pl b/TAO/performance-tests/Latency/multi_threaded.pl index 62a81e05b40..1fdc3496661 100755 --- a/TAO/performance-tests/Latency/multi_threaded.pl +++ b/TAO/performance-tests/Latency/multi_threaded.pl @@ -5,47 +5,46 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -use lib "../../../bin"; -use PerlACE::Run_Test; +unshift @INC, '../../../bin'; +require ACEutils; -$iorfile = PerlACE::LocalFile ("test.ior"); -$server_conf = PerlACE::LocalFile ("server.conf"); -$client_conf = PerlACE::LocalFile ("client.conf"); +$iorfile = "test.ior"; print STDERR "================ Multi-threaded test\n"; unlink $iorfile; -$SV = new PerlACE::Process ("st_server", - " -ORBSvcConf $server_conf" - . " -o $iorfile"); +$SV = Process::Create ($EXEPREFIX."st_server$EXE_EXT ", + " -ORBSvcConf server.conf" + . " -o $iorfile"); -$CL = new PerlACE::Process ("st_client", - " -ORBSvcConf $client_conf " - . " -k file://$iorfile " - . " -i 50000"); +if (ACE::waitforfile_timed ($iorfile, 5) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} -$SV->Spawn (); +$CL = Process::Create ($EXEPREFIX."st_client$EXE_EXT ", + " -ORBSvcConf client.conf " + . " -k file://$iorfile " + . " -i 50000"); -if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; +$client = $CL->TimedWait (60); +if ($client == -1) { + print STDERR "ERROR: client timedout\n"; + $CL->Kill (); $CL->TimedWait (1); } -$client = $CL->SpawnWaitKill (60); -$server = $SV->WaitKill (10); +$server = $SV->TimedWait (5); +if ($server == -1) { + print STDERR "ERROR: server timedout\n"; + $SV->Kill (); $SV->TimedWait (1); +} unlink $iorfile; -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; +if ($server != 0 || $client != 0) { + exit 1; } -exit $status; +exit 0; |