You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2006/12/12 14:53:30 UTC

svn commit: r486142 - /spamassassin/trunk/t/spamd_hup.t

Author: jm
Date: Tue Dec 12 05:53:30 2006
New Revision: 486142

URL: http://svn.apache.org/viewvc?view=rev&rev=486142
Log:
another spot where CPU contention can result in test suite moving faster than spamd, and tests failing as a result

Modified:
    spamassassin/trunk/t/spamd_hup.t

Modified: spamassassin/trunk/t/spamd_hup.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/spamd_hup.t?view=diff&rev=486142&r1=486141&r2=486142
==============================================================================
--- spamassassin/trunk/t/spamd_hup.t (original)
+++ spamassassin/trunk/t/spamd_hup.t Tue Dec 12 05:53:30 2006
@@ -4,7 +4,7 @@
 use SATest; sa_t_init("spamd_hup");
 use constant TEST_ENABLED => !$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS;
 
-use Test; BEGIN { plan tests => (TEST_ENABLED? 80 : 0) };
+use Test; BEGIN { plan tests => (TEST_ENABLED? 100 : 0) };
 
 use File::Spec;
 
@@ -23,11 +23,15 @@
 for $retry (0 .. 9) {
   ok ($pid1 = get_pid());
   print "HUPing spamd at pid $pid1, loop try $retry...\n";
+  ok (-e $pid_file) or warn "$pid_file is not there before SIGHUP";
   ok ($pid1 != 0 and kill ('HUP', $pid1));
 
+  sleep 1;      # time for signal to be received
+  ok (!-e $pid_file) or warn "$pid_file is there 1 sec after SIGHUP";
+
   print "Waiting for spamd at pid $pid1 to restart...\n";
-# note that the wait period increases the longer it takes,
-# 20 retries works out to a total of 60 seconds
+  # note that the wait period increases the longer it takes,
+  # 20 retries works out to a total of 60 seconds
   my $timeout = 20;
   my $wait = 0;
   do {
@@ -38,7 +42,7 @@
 
   ok ($pid2 = get_pid($pid1));
   print "Looking for new spamd at pid $pid2...\n";
-#ok ($pid2 != $pid1);
+  #ok ($pid2 != $pid1);
   ok ($pid2 != 0 and kill (0, $pid2));
 
   print "Checking GTUBE...\n";