コード例 #1
0
ファイル: PreDAG_t.py プロジェクト: mmascher/CRABServer
 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)
コード例 #2
0
ファイル: PreDAG_t.py プロジェクト: belforte/CRABServer
 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)
コード例 #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)
コード例 #4
0
ファイル: PreDAG_t.py プロジェクト: todor-ivanov/CRABServer
 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)
コード例 #5
0
ファイル: PreDAG_t.py プロジェクト: belforte/CRABServer
 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)
コード例 #6
0
ファイル: PreDAG_t.py プロジェクト: belforte/CRABServer
 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)
コード例 #7
0
ファイル: PreDAG_t.py プロジェクト: belforte/CRABServer
 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)
コード例 #8
0
ファイル: PreDAG_t.py プロジェクト: belforte/CRABServer
 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)
コード例 #9
0
ファイル: PreDAG_t.py プロジェクト: belforte/CRABServer
 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)
コード例 #10
0
ファイル: PreDAG_t.py プロジェクト: todor-ivanov/CRABServer
 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)
コード例 #11
0
ファイル: PreDAG_t.py プロジェクト: todor-ivanov/CRABServer
 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)
コード例 #12
0
ファイル: PreDAG_t.py プロジェクト: todor-ivanov/CRABServer
 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)
コード例 #13
0
ファイル: PreDAG_t.py プロジェクト: mmascher/CRABServer
 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)
コード例 #14
0
ファイル: PreDAG_t.py プロジェクト: belforte/CRABServer
 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)
コード例 #15
0
ファイル: PreDAG_t.py プロジェクト: todor-ivanov/CRABServer
 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)
コード例 #16
0
ファイル: PreDAG_t.py プロジェクト: todor-ivanov/CRABServer
 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)
コード例 #17
0
ファイル: PreDAG_t.py プロジェクト: mmascher/CRABServer
 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)
コード例 #18
0
ファイル: PreDAG_t.py プロジェクト: todor-ivanov/CRABServer
 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)
コード例 #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)
コード例 #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)