Hi,
please find enclosed patch (against RPC-XML-0.64) for 40_server.t that
solves issue discussed here:
1) to prevent hang ups on Win32 it is necessary to send kill 'KILL'
instead of kill 'INT' (on win32 the forked processes are in fact threads
and behaves slightly differently than on UNIX systems - do not know why
but KILL helps)
2) another issue handled by this patch is that
gethostbyname('localhost') on win32 does not return in a resulting array
string "localhost"
In the end please remove 41_server_hang.t (does not work on Win32).
--
kmx
diff -r -u RPC-XML-0.64/t/40_server.t RPC-XML-0.64_new/t/40_server.t
--- RPC-XML-0.64/t/40_server.t 2008-09-29 13:22:54.000000000 +0200
+++ RPC-XML-0.64_new/t/40_server.t 2009-05-12 09:33:39.398898700 +0200
@@ -63,6 +63,8 @@
my $localIP = join('.', unpack('C4', $localhostinfo[4]));
my @allhosts = ($localIP, $localhostinfo[0], split(' ', $localhostinfo[1]));
for (@allhosts) { s/\./\\./g }
+# for some reason gethostbyname('localhost') does not return "localhost" on win32
+push @allhosts, "localhost" if $^O eq "MSWin32";
my $allhosts = join('|', @allhosts);
like($srv->url, qr{http://($allhosts):$port},
'RPC::XML::Server::url method (set)'); # This should be non-null this time
@@ -104,7 +106,7 @@
is($res->value->value, 1, 'First live req: $res value test');
}
}
-kill 'INT', $child;
+kill 'KILL', $child;
# Try deleting the method
ok(ref $srv->delete_method('perl.test.suite.test1'),
@@ -148,7 +150,7 @@
'Second live request: correct faultString');
}
}
-kill 'INT', $child;
+kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -178,7 +180,7 @@
'Third request: pack_sockaddr_in validates all');
}
}
-kill 'INT', $child;
+kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -217,7 +219,7 @@
'RT29351 live request: correct faultString');
}
}
-kill 'INT', $child;
+kill 'KILL', $child;
# OK-- At this point, basic server creation and accessors have been validated.
# We've run a remote method and we've correctly failed to run an unknown remote
@@ -272,7 +274,7 @@
die "Server allocation failed, cannot continue. Message was: $srv"
unless (ref $srv);
-kill 'INT', $child;
+kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -301,7 +303,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -325,7 +327,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -347,7 +349,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -375,7 +377,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -401,7 +403,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -426,7 +428,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -453,7 +455,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -479,7 +481,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -507,7 +509,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -533,7 +535,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -582,7 +584,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -613,7 +615,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -643,7 +645,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -673,7 +675,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -701,7 +703,7 @@
# HTTP::Message::content might have killed it already via croak().
unless ($res) # $res was made null above if it was an error
{
- kill 'INT', $child;
+ kill 'KILL', $child;
# Start the server again
sleep 1; # To allow the old sockets time enough to go away
@@ -721,5 +723,5 @@
}
# Don't leave any children laying around
-kill 'INT', $child;
+kill 'KILL', $child;
exit;