diff options
author | Phil Mesnier <mesnierp@ociweb.com> | 2015-11-18 13:15:35 -0600 |
---|---|---|
committer | Phil Mesnier <mesnierp@ociweb.com> | 2015-11-18 13:15:35 -0600 |
commit | 6095e56dc88e15906a0e008892eae3372585a293 (patch) | |
tree | f97e70c24b7569210eb6085e68afedcae0f27992 | |
parent | ab036e452cf1add954cf0f410badc991295f83d0 (diff) | |
download | ATCD-6095e56dc88e15906a0e008892eae3372585a293.tar.gz |
Add a new test case to the kill server test. This matches a scenario that was leading to hung clients
-rw-r--r-- | TAO/bin/imr_tests.lst | 8 | ||||
-rw-r--r-- | TAO/bin/tao_other_tests.lst | 2 | ||||
-rwxr-xr-x | TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/kill_server/README | 6 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/kill_server/client.cpp | 16 | ||||
-rwxr-xr-x | TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl | 119 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/kill_server/server.cpp | 7 |
7 files changed, 107 insertions, 53 deletions
diff --git a/TAO/bin/imr_tests.lst b/TAO/bin/imr_tests.lst index 7bc28f0af52..9bffac47a1e 100644 --- a/TAO/bin/imr_tests.lst +++ b/TAO/bin/imr_tests.lst @@ -12,9 +12,9 @@ TAO/orbsvcs/tests/ImplRepo/run_test.pl nestea_ir: !MINIMUM !CORBA_E_COMPACT !COR TAO/orbsvcs/tests/ImplRepo/run_test.pl airplane_ir: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO TAO/orbsvcs/tests/ImplRepo/run_test.pl persistent_ir: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO TAO/orbsvcs/tests/ImplRepo/run_test.pl nt_service_ir: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR Win32 !ACE_FOR_TAO -TAO/orbsvcs/tests/ImplRepo/run_test.pl shutdown: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/run_test.pl shutdown: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO !OSX TAO/orbsvcs/tests/ImplRepo/run_test.pl perclient: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO -TAO/orbsvcs/tests/ImplRepo/run_test.pl persistent_ir_hash: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/run_test.pl persistent_ir_hash: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !OSX TAO/orbsvcs/tests/ImplRepo/run_test.pl persistent_ir_shared: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !Win32 TAO/orbsvcs/tests/ImplRepo/run_test.pl failover -replica: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !Win32 TAO/orbsvcs/tests/ImplRepo/run_test.pl backup_restart -replica: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !Win32 @@ -27,9 +27,11 @@ TAO/orbsvcs/tests/ImplRepo/PICurrent/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT TAO/orbsvcs/tests/ImplRepo/double_start/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS !Win32 TAO/orbsvcs/tests/ImplRepo/double_start/run_test.pl -kill: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS !Win32 !FIXED_BUGS_ONLY TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl -rm2523: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl -rm2523 -start_delay 3: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO TAO/orbsvcs/tests/ImplRepo/kill_slow_server/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO TAO/orbsvcs/tests/ImplRepo/oneway/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO -TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO !OSX TAO/orbsvcs/tests/ImplRepo/manual_start/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO !OpenVMS TAO/orbsvcs/tests/ImplRepo/scale/run_test.pl -servers 5 -objects 5: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS TAO/orbsvcs/tests/ImplRepo/scale_clients/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS diff --git a/TAO/bin/tao_other_tests.lst b/TAO/bin/tao_other_tests.lst index 4c3d8d4c9da..bd8aed52012 100644 --- a/TAO/bin/tao_other_tests.lst +++ b/TAO/bin/tao_other_tests.lst @@ -132,6 +132,8 @@ TAO/orbsvcs/tests/ImplRepo/PICurrent/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT TAO/orbsvcs/tests/ImplRepo/double_start/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS !Win32 TAO/orbsvcs/tests/ImplRepo/double_start/run_test.pl -kill: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS !Win32 !FIXED_BUGS_ONLY TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl -rm2523: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl -rm2523 -start_delay 3: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO TAO/orbsvcs/tests/ImplRepo/kill_slow_server/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO TAO/orbsvcs/tests/ImplRepo/oneway/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl index f438778143e..861e4453d24 100755 --- a/TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl +++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl @@ -20,7 +20,7 @@ foreach $i (@ARGV) { if ($i eq '-debug') { $debugging = 1; $imr_debug = "-ORBDebugLevel 10 -ORBVerboseLogging 1 -ORBLogFile imr.log -d 5 "; - $act_debug = "-ORBDebugLevel 10 -ORBVerboseLogging 1 -ORBLogFile imr.log -d 5 "; + $act_debug = "-ORBDebugLevel 10 -ORBVerboseLogging 1 -ORBLogFile act.log -d 5 "; } elsif ($i eq '-manual') { # in manual mode the server is manually started, so it should diff --git a/TAO/orbsvcs/tests/ImplRepo/kill_server/README b/TAO/orbsvcs/tests/ImplRepo/kill_server/README index 10e5eb0d5d3..0390eb5cd8a 100644 --- a/TAO/orbsvcs/tests/ImplRepo/kill_server/README +++ b/TAO/orbsvcs/tests/ImplRepo/kill_server/README @@ -1,4 +1,8 @@ This test starts up servers then uses the tao_imr kill command to force server -termination via signal.
\ No newline at end of file +termination via signal. + +Extension test "-rm2523" is a variation that removes a killed server from the +locator repository then readding it while simulating a heavy machine load by forcing +delay in reporting server death. diff --git a/TAO/orbsvcs/tests/ImplRepo/kill_server/client.cpp b/TAO/orbsvcs/tests/ImplRepo/kill_server/client.cpp index c2412e04056..5c05442041c 100644 --- a/TAO/orbsvcs/tests/ImplRepo/kill_server/client.cpp +++ b/TAO/orbsvcs/tests/ImplRepo/kill_server/client.cpp @@ -5,16 +5,20 @@ char pause_poa = ' '; char resume_poa = ' '; +bool expect_transient = false; int parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("")); + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("e")); int c; while ((c = get_opts ()) != -1) switch (c) { + case 'e': + expect_transient = true; + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, @@ -46,13 +50,19 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "Client received reply from server %d\n", n)); - + if (expect_transient) + return -1; return 0; } + catch(const CORBA::TRANSIENT& ex) { + if (expect_transient) + return 0; + + ex._tao_print_exception ("client:"); + } catch(const CORBA::Exception& ex) { ex._tao_print_exception ("client:"); } - return -1; } diff --git a/TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl index ced79d40467..48d353a46f2 100755 --- a/TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl +++ b/TAO/orbsvcs/tests/ImplRepo/kill_server/run_test.pl @@ -16,7 +16,8 @@ my $servers_count = 2; my $servers_kill_count = 1; my $signalnum = 9; my $rm2523 = 0; -my $act_delay = 00; #msec +my $act_delay = 800; #msec +my $start_delay = 0; #sec if ($#ARGV >= 0) { for (my $i = 0; $i <= $#ARGV; $i++) { @@ -41,6 +42,11 @@ if ($#ARGV >= 0) { $signalnum = 15; $servers_count = 3; } + elsif ($ARGV[$i] eq "-start_delay") { + $i++; + # $act_delay = 0; + $start_delay = $ARGV[$i]; + } else { usage(); exit 1; @@ -193,7 +199,7 @@ sub servers_setup () $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ". "add $objprefix" . '_' . $i . "_a -c \"". $srv_server_cmd[$i]. - " -ORBUseIMR 1 -n $i ". + " -ORBUseIMR 1 -n $i -d $start_delay ". "-orbendpoint iiop://localhost: " . "-ORBInitRef ImplRepoService=file://$srv_imriorfile\""); @@ -297,17 +303,42 @@ sub make_server_requests() ##### Run client against servers to active them ##### for(my $i = 0; $i < $servers_count; $i++ ) { - my $status_file_name = $objprefix . "_$i.status"; - $CLI->Arguments ("-ORBInitRef Test=corbaloc::localhost:$port/$objprefix" . '_' . $i . "_a" ); + $CLI->Arguments ("-ORBInitRef Test=corbaloc::localhost:$port/$objprefix" . '_' . $i . "_a" . $debug ); $CLI_status = $CLI->SpawnWaitKill ($cli->ProcessStartWaitInterval()); if ($CLI_status != 0) { print STDERR "ERROR: client returned $CLI_status\n"; $status = 1; - last; } } } +sub trigger_the_one () +{ + print "Starting slow server\n"; + + my $i = 1; + my $opt_arg = " -e" if ($start_delay > 0); + $CLI->Arguments ("-ORBInitRef Test=corbaloc::localhost:$port/$objprefix" . '_' . $i . "_a" . + $opt_arg); + $CLI_status = $CLI->Spawn ($cli->ProcessStartWaitInterval()); + if ($CLI_status != 0) { + print STDERR "ERROR: client returned $CLI_status\n"; + $status = 1; + last; + } +} + +sub wait_for_client () +{ + print "Wait for client exit\n" ; + + $CLI_status = $CLI->WaitKill (10); + if ($CLI_status != 0) { + print STDERR "ERROR: client returned $CLI_status\n"; + $status = 1; + } +} + sub shutdown_servers(@) { my $start_index = shift; @@ -376,52 +407,52 @@ sub rm2523_test my $start_time = time(); servers_setup(); - # Make sure servers are active whether activator is used or not by making - # CORBA requests. - make_server_requests(); - - list_servers("-a"); + if ($start_delay == 0) { + make_server_requests(); + list_servers("-a"); - print "Update to manual\n"; - update_manual(); - list_servers("-v"); + print "Update to manual\n"; + update_manual(); + list_servers("-v"); - print "kill the one\n"; - kill_the_one(); - list_servers(""); + print "kill the one\n"; + kill_the_one(); + list_servers(""); - print "remove peer\n"; - remove_entry("b"); - list_servers("-a"); + print "remove primary\n"; + remove_entry("a"); + list_servers(""); - print "remove primary\n"; - remove_entry("a"); - list_servers(""); + sleep 1; - sleep 1; + print "kill the one again\n"; + kill_the_one(); + list_servers(""); - print "kill the one again\n"; - kill_the_one(); - list_servers(""); - - print "re-add entry\n"; - update_normal(); - list_servers(""); - - print "kill the one again\n"; - kill_the_one(); - list_servers("-a"); - list_servers(""); - - print "start the server\n"; - start_the_one (); - list_servers("-a"); - - sleep 2; - print "start the server again\n"; - start_the_one (); - list_servers("-a"); + print "re-add entry\n"; + update_normal(); + list_servers(""); + print "start the server\n"; + start_the_one (); + list_servers("-a"); + } + else { + print "start_all - total delay " . ($servers_count * $start_delay) . " seconds\n"; + make_server_requests (); + print "kill then list\n"; + kill_the_one (); + list_servers(""); + sleep 2; + print "triggering the one\n"; + trigger_the_one (); + kill_the_one (); + list_servers("-a"); + sleep 1; + remove_entry ("a"); + + wait_for_client (); + } shutdown_servers (0, $servers_count, 9); my $ACT_status = $ACT->TerminateWaitKill ($act->ProcessStopWaitInterval()); diff --git a/TAO/orbsvcs/tests/ImplRepo/kill_server/server.cpp b/TAO/orbsvcs/tests/ImplRepo/kill_server/server.cpp index 556e91f675f..415978bcc12 100644 --- a/TAO/orbsvcs/tests/ImplRepo/kill_server/server.cpp +++ b/TAO/orbsvcs/tests/ImplRepo/kill_server/server.cpp @@ -64,13 +64,17 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); int server_num = 0; + int start_delay = 0; - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("n:?")); + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("d:n:?")); int c; while ((c = get_opts ()) != -1) switch (c) { + case 'd': + start_delay = ACE_OS::atoi (get_opts.opt_arg ()); + break; case 'n': server_num = ACE_OS::atoi (get_opts.opt_arg ()); break; @@ -125,6 +129,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // // Stop discarding requests. // + ACE_OS::sleep (start_delay); activatePOAs (); // |