Example #1
0
 def testDependencies(self):
     '''Check that dependencies work'''
     pool = BatchJobPool(24)
     last_id = None
     for i in range(10):
         last_id = pool.add(dep_function, [i], {}, deps=[last_id])
     pool.join()
Example #2
0
 def testIOFailure(self):
     '''Check that IO failures are reported'''
     pool = BatchJobPool(24)
     pool.add(ioerror_function, [], {}, deps=[])
     raised = False
     # For some reason assertRaises does not accept this
     # exception. Maybe because it has been pickled?
     try:
         pool.join()
     except Exception as e:
         self.assertIn("IOError", str(e))
         raised = True
     self.assertEqual(raised, True)
Example #3
0
 def testUnpickleableFailure(self):
     '''Check that unpickleable Exceptions are reported'''
     pool = BatchJobPool(24)
     pool.add(unpickleable_error_function, [], {}, deps=[])
     raised = False
     # For some reason assertRaises does not accept this
     # exception. Maybe because it has been pickled?
     try:
         pool.join()
     except Exception as e:
         self.assertIn("MyEx", str(e))
         raised = True
     self.assertEqual(raised, True)
     unlink(TMPFILE)
Example #4
0
 def testFastFunctions(self):
     '''Check that fast functions work'''
     pool = BatchJobPool(24)
     for i in range(240):
         pool.add(fast_function, [i], {}, deps="")
     pool.join()
Example #5
0
 def testBasicFunctionality(self):
     '''Check that basic processing works'''
     pool = BatchJobPool(24)
     for i in range(10):
         pool.add(test_function, [i], {}, deps="")
     pool.join()