Merge in removal of queuecommand sleep.
authorDiane Trout <diane@caltech.edu>
Mon, 7 Nov 2011 20:16:28 +0000 (12:16 -0800)
committerDiane Trout <diane@caltech.edu>
Mon, 7 Nov 2011 20:16:28 +0000 (12:16 -0800)
htsworkflow/util/queuecommands.py
htsworkflow/util/test/test_queuecommands.py

index 2b7da653bedb0c806530e05b28a08d44d8b0b3dd..4396f0a5b7bcd76259248a84102e008f2d5ae594 100644 (file)
@@ -95,4 +95,3 @@ class QueueCommands(object):
                     buffer = buffer.strip()
                     msg = "%d:(%d) %s" %(pending.pid, len(buffer), buffer)
                     LOGGER.debug(msg)
-            time.sleep(1)
index f52e428c35df717355495ee4580147a29a4ebb09..dc745a6ff6d2c6d60d4a8274281c4989fd65b2a2 100644 (file)
@@ -20,14 +20,13 @@ class testQueueCommands(unittest.TestCase):
                 '/bin/sleep 1',
                 '/bin/sleep 2',]
 
-        q = QueueCommands(cmds)
+        q = QueueCommands(cmds, 3)
         start = time.time()
         q.run()
         end = time.time()-start
         # we should only take the length of the longest sleep
-        # pity I had to add a 1 second sleep
-        self.failUnless( end > 2.9 and end < 3.1,
-                         "took %s seconds, exected ~3" % (end,))
+        self.failUnless( end > 1.9 and end < 2.1,
+                         "took %s seconds, exected ~2" % (end,))
 
     def test_limited_run_slow(self):
         """
@@ -42,9 +41,8 @@ class testQueueCommands(unittest.TestCase):
         start = time.time()
         q.run()
         end = time.time()-start
-        # pity I had to add a 1 second sleep
-        self.failUnless( end > 5.9 and end < 6.1,
-                         "took %s seconds, expected ~6" % (end,))
+        self.failUnless( end > 3.9 and end < 4.1,
+                         "took %s seconds, expected ~4" % (end,))
 
 def suite():
     return unittest.makeSuite(testQueueCommands, 'test')