From: Diane Trout Date: Mon, 7 Nov 2011 20:16:28 +0000 (-0800) Subject: Merge in removal of queuecommand sleep. X-Git-Tag: v0.5.5~82 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=2aa7a2615a43a41de014bb12f8d4cdd83b06235e Merge in removal of queuecommand sleep. --- diff --git a/htsworkflow/util/queuecommands.py b/htsworkflow/util/queuecommands.py index 2b7da65..4396f0a 100644 --- a/htsworkflow/util/queuecommands.py +++ b/htsworkflow/util/queuecommands.py @@ -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) diff --git a/htsworkflow/util/test/test_queuecommands.py b/htsworkflow/util/test/test_queuecommands.py index f52e428..dc745a6 100644 --- a/htsworkflow/util/test/test_queuecommands.py +++ b/htsworkflow/util/test/test_queuecommands.py @@ -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')