[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Kill a somewhat unpleasant Cygwin-only heisenbug in the...



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv3326/lib/mixminion

Modified Files:
	test.py testSupport.py 
Log Message:
Kill a somewhat unpleasant Cygwin-only heisenbug in the unittests. Note needed improvement in ServerConfig interface

Index: test.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/test.py,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- test.py	3 Sep 2003 15:54:18 -0000	1.151
+++ test.py	5 Sep 2003 00:46:24 -0000	1.152
@@ -3328,7 +3328,7 @@
             private = permissive = public = 0777
         else:
             private, permissive, public = 0700, 0777, 0755
-	
+
         # Okay.  Now we try createPrivateDir a couple of times...
         old_mask = None
         try:
@@ -4389,6 +4389,12 @@
         eq(info['Server']['Published'], loaded['Server']['Published'])
         eq(info.isValidated(), loaded.isValidated())
 
+
+        #XXXX006 this is a workaround to deal with the fact that we've
+        #XXXX006 opened a fragment DB just to configure the server. Not
+        #XXXX006 cool.
+        conf.getModuleManager().close()
+
         # Now with a shorter configuration
         try:
             suspendLog()
@@ -4913,6 +4919,7 @@
             self.failUnless(stringContains(info,"\n[Example]\nFoo: 99\n"))
         finally:
             resumeLog()
+        manager.close()
 
         # Try again, this time with the test module disabled.
         #
@@ -4945,6 +4952,7 @@
 """ % (mod_dir)
 
         # FFFF Add tests for catching exceptions from buggy modules
+        manager.close()
 
     def testDecoding(self):
         'test decoding and test encapsulation.'
@@ -5185,6 +5193,7 @@
         finally:
             undoReplacedAttributes()
             clearReplacedFunctionCallLog()
+        manager.close()
 
     def testDirectSMTP(self):
         """Check out the SMTP module.  (We temporarily replace sendSMTPMessage
@@ -5530,6 +5539,7 @@
         finally:
             undoReplacedAttributes()
             clearReplacedFunctionCallLog()
+        manager.close()
 
     def getManager(self, extraConfig=None):
         d = mix_mktemp()
@@ -6744,6 +6754,7 @@
         # Force pkts2 to rejected by expiring it.
         pool.expireMessages(time.time()+48*60*60)
         self.assertEquals(pool.listReadyMessages(), [])
+        pool.close()
         
 #----------------------------------------------------------------------
 def testSuite():
@@ -6753,7 +6764,7 @@
     tc = loader.loadTestsFromTestCase
 
     if 0:
-        suite.addTest(tc(ModuleTests))
+        suite.addTest(tc(ServerInfoTests))
         return suite
     testClasses = [MiscTests,
                    MinionlibCryptoTests,
@@ -6770,8 +6781,8 @@
                    FragmentTests,
                    QueueTests,
                    EventStatsTests,
+           
                    ModuleTests,
-
                    ClientMainTests,
                    ServerKeysTests,
                    ServerMainTests,
@@ -6779,7 +6790,8 @@
                    # These tests are slowest, so we do them last.
                    ModuleManagerTests,
                    ServerInfoTests,
-                   MMTPTests]
+                   MMTPTests
+                  ]
 
     for cl in testClasses:
         suite.addTest(tc(cl))

Index: testSupport.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/testSupport.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- testSupport.py	1 Jul 2003 21:18:32 -0000	1.19
+++ testSupport.py	5 Sep 2003 00:46:24 -0000	1.20
@@ -214,7 +214,8 @@
                 else:
                     #print "unlinking (I)",loc
                     os.unlink(loc)
-            #print "remaining in %s: %s" % (d, os.listdir(d))
+            #ld = os.listdir(d)
+            #if ld: print "remaining in %s: %s" % (d, ld)
             os.rmdir(d)
         elif os.path.exists(d):
             #print "Unlinking", d