Esempio n. 1
0
 def testSplitting(self):
     """ Test that the PreDAG works when probe jobs finishes
     """
     predag = PreDAG()
     #Mock the createSubdagSubmission function
     predag.createSubdagSubmission = lambda *args: True
     self.assertEqual(predag.execute("processing", 5, 0), 0)
Esempio n. 2
0
 def testTailSplitting(self):
     """ Test that the PreDAG works when there are tail jobs to create
     """
     predag = PreDAG()
     self.createStatusCache()
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     with open('RunJobs1.subdag') as fd:
         self.assertEqual(sum(1 for _ in (line for line in fd if line.startswith('JOB'))), 1)
Esempio n. 3
0
 def testTailSplittingWithAllProcessed(self):
     """ Test that the PreDAG works when there are no tail jobs to create
     """
     shutil.rmtree(self.missing_lumidir)
     predag = PreDAG()
     self.createStatusCache()
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     self.assertEqual(os.path.exists('RunJobs1.subdag'), False)
Esempio n. 4
0
 def testTailSplittingWithAllProcessed(self):
     """ Test that the PreDAG works when there are no tail jobs to create
     """
     self.createFakePostjobData(missingLumis=None)
     predag = PreDAG()
     self.createStatusCache()
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     self.assertEqual(os.path.exists('RunJobs1.subdag'), False)
Esempio n. 5
0
 def testTailSplittingWithAllProcessed(self):
     """ Test that the PreDAG works when there are no tail jobs to create
     """
     self.createFakePostjobData(missingLumis=None)
     predag = PreDAG()
     self.createStatusCache()
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     self.assertEqual(os.path.exists('RunJobs1.subdag'), False)
Esempio n. 6
0
 def testTailSplittingWithFailedProbesAndAllProcessed(self):
     """ Test that the PreDAG works when there are no tail jobs to create, but failed probes
     """
     self.createFakePostjobData(missingLumis=None)
     predag = PreDAG()
     self.createStatusCache(overrides=dict((p, 'failed') for p in self.probes[1:]))
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     self.assertEqual(os.path.exists('RunJobs1.subdag'), False)
Esempio n. 7
0
 def testTailSplittingWithFailedProbes(self):
     """ Test that the PreDAG works when there are tail jobs to create, and failed probes
     """
     predag = PreDAG()
     self.createStatusCache(overrides=dict((p, 'failed') for p in self.probes[1:]))
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     with open('RunJobs1.subdag') as fd:
         self.assertEqual(sum(1 for _ in (line for line in fd if line.startswith('JOB'))), 1)
Esempio n. 8
0
 def testSplitting(self):
     """ Test that the PreDAG works when probe jobs finishes
     """
     predag = PreDAG()
     # Mock the createSubdagSubmission function
     self.assertEqual(predag.execute("processing", 5, 0), 0)
     with open('RunJobs0.subdag') as fd:
         self.assertEqual(sum(1 for _ in (line for line in fd if line.startswith('JOB'))), 50)
Esempio n. 9
0
 def testSplittingWithHighOutput(self):
     """ Test that the PreDAG works when probe jobs finishes, with more jobs created due to large output size.
     """
     self.createFakePostjobData(eventSize=100000)
     predag = PreDAG()
     # Mock the createSubdagSubmission function
     self.assertEqual(predag.execute("processing", 5, 0), 0)
     with open('RunJobs0.subdag') as fd:
         self.assertGreater(sum(1 for _ in (line for line in fd if line.startswith('JOB'))), 100)
Esempio n. 10
0
 def testTailSplittingWithFailedProbesAndAllProcessed(self):
     """ Test that the PreDAG works when there are no tail jobs to create, but failed probes
     """
     self.createFakePostjobData(missingLumis=None)
     predag = PreDAG()
     self.createStatusCache(overrides=dict(
         (p, 'failed') for p in self.probes[1:]))
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     self.assertEqual(os.path.exists('RunJobs1.subdag'), False)
Esempio n. 11
0
 def testTailSplitting(self):
     """ Test that the PreDAG works when there are tail jobs to create
     """
     predag = PreDAG()
     self.createStatusCache()
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     with open('RunJobs1.subdag') as fd:
         self.assertEqual(
             sum(1 for _ in (line for line in fd
                             if line.startswith('JOB'))), 1)
Esempio n. 12
0
 def testSplitting(self):
     """ Test that the PreDAG works when probe jobs finishes
     """
     predag = PreDAG()
     # Mock the createSubdagSubmission function
     self.assertEqual(predag.execute("processing", 5, 0), 0)
     with open('RunJobs0.subdag') as fd:
         self.assertEqual(
             sum(1 for _ in (line for line in fd
                             if line.startswith('JOB'))), 50)
Esempio n. 13
0
 def testTailSplitting(self):
     """ Test that the PreDAG works when there are tail jobs to create
     """
     predag = PreDAG()
     predag.createSubdagSubmission = lambda *args: True
     predag.completedJobs = lambda *args, **kwargs: self.done
     predag.failedJobs = []
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     with open('RunJobs1.subdag') as fd:
         self.assertEqual(sum(1 for _ in (line for line in fd if line.startswith('JOB'))), 1)
Esempio n. 14
0
 def testAllProcessingFailed(self):
     """ Check that we don't fail if all processing jobs fail
     """
     self.createFakePostjobData(jobs=self.probes, missingLumis=None)
     self.createStatusCache(job_status='failed')
     predag = PreDAG()
     predag.createSubdag = lambda *args: True
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     with open('RunJobs1.subdag') as fd:
         self.assertEqual(sum(1 for _ in (line for line in fd if line.startswith('JOB'))), 17)
Esempio n. 15
0
 def testSplittingWithHighOutput(self):
     """ Test that the PreDAG works when probe jobs finishes, with more jobs created due to large output size.
     """
     self.createFakePostjobData(eventSize=100000)
     predag = PreDAG()
     # Mock the createSubdagSubmission function
     self.assertEqual(predag.execute("processing", 5, 0), 0)
     with open('RunJobs0.subdag') as fd:
         self.assertGreater(
             sum(1 for _ in (line for line in fd
                             if line.startswith('JOB'))), 100)
Esempio n. 16
0
 def testTailSplittingWithFailedProbes(self):
     """ Test that the PreDAG works when there are tail jobs to create, and failed probes
     """
     predag = PreDAG()
     self.createStatusCache(overrides=dict(
         (p, 'failed') for p in self.probes[1:]))
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     with open('RunJobs1.subdag') as fd:
         self.assertEqual(
             sum(1 for _ in (line for line in fd
                             if line.startswith('JOB'))), 1)
Esempio n. 17
0
 def testAllProcessingFailed(self):
     """ Check that we don't fail if all processing jobs fail
     """
     for p in self.done:
         os.unlink(os.path.join(self.throughputdir, p))
     predag = PreDAG()
     predag.createSubdagSubmission = lambda *args: True
     predag.completedJobs = lambda *args, **kwargs: self.probes if kwargs['stage'] == 'processing' else self.done
     predag.failedJobs = self.done
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     with open('RunJobs1.subdag') as fd:
         self.assertEqual(sum(1 for _ in (line for line in fd if line.startswith('JOB'))), 17)
Esempio n. 18
0
 def testAllProcessingFailed(self):
     """ Check that we don't fail if all processing jobs fail
     """
     self.createFakePostjobData(jobs=self.probes, missingLumis=None)
     self.createStatusCache(job_status='failed')
     predag = PreDAG()
     predag.createSubdag = lambda *args: True
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     with open('RunJobs1.subdag') as fd:
         self.assertEqual(
             sum(1 for _ in (line for line in fd
                             if line.startswith('JOB'))), 17)
Esempio n. 19
0
 def testAllProcessingFailed(self):
     """ Check that we don't fail if all processing jobs fail
     """
     for p in self.done:
         os.unlink(os.path.join(self.throughputdir, p))
     shutil.rmtree(self.missing_lumidir)
     self.createStatusCache(job_status='failed')
     predag = PreDAG()
     predag.createSubdag = lambda *args: True
     self.assertEqual(predag.execute("tail", 6, 1), 0)
     with open('RunJobs1.subdag') as fd:
         self.assertEqual(
             sum(1 for _ in (line for line in fd
                             if line.startswith('JOB'))), 17)
Esempio n. 20
0
 def testSplitting(self):
     """ Test that the PreDAG works when probe jobs finishes
     """
     predag = PreDAG()
     #Mock the createSubdagSubmission function
     self.assertEqual(predag.execute("processing", 5, 0), 0)