def test_AddRemove(self): from Ganga.GPI import Job, jobs j = Job() assert(len(jobs) == 1) j.remove() assert(len(jobs) == 0)
def test_Savannah18215(self): from Ganga.GPI import Job # test manual failing and removal of jobs stuck in submitting or completing states j = Job() goto_state(j, 'submitting') j.force_status('failed') j.remove() j = Job() goto_state(j, 'completing') j.force_status('failed') j.remove() j = Job() goto_state(j, 'completed') j.force_status('failed') j.remove() j = Job() goto_state(j, 'failed') j.force_status('failed') j.remove() j = Job() goto_state(j, 'killed') j.force_status('failed') j.remove()
def testSavannah13404(self): from Ganga.GPI import Job j=Job() assert( os.path.exists( j.inputdir + '/..' ) ) j.remove() # The job directory should be deleted assert( not os.path.exists( os.path.abspath( j.inputdir + '/..' ) ) )
def test_AddRemove(self): from Ganga.GPI import Job, jobs j = Job() assert (len(jobs) == 1) j.remove() assert (len(jobs) == 0)
def test_Savannah13404(self): from Ganga.GPI import Job j = Job() j.submit() # Needed in order to create the workspace self.assertTrue(os.path.exists(j.inputdir + '/..')) j.remove() # The job directory should be deleted self.assertFalse(os.path.exists(os.path.abspath(j.inputdir + '/..')))
def test_SubmitAndRemoval(self): from Ganga.GPI import Job, TestSubmitter j = Job() j.backend = TestSubmitter(time=1, update_delay=5) j.submit() all = [j] for i in range(10): j2 = j.copy() j2.submit() all.append(j2) for j in all: j.remove()
def testMergeRemoval(self): from Ganga.GPI import Job, Executable, Local, LocalFile, jobs # see Savannah 33710 j = Job() jobID = j.id # job will run for at least 20 seconds j.application = Executable(exe="sh", args=["-c", "sleep 20; echo foo > out.txt"]) j.backend = Local() j.outputfiles = [LocalFile("out.txt")] j.splitter = CopySplitter() j.postprocessors = MergerTester(files=["out.txt"]) j.postprocessors[0].ignorefailed = True j.postprocessors[0].alwaysfail = True j.postprocessors[0].wait = 10 j.submit() run_until_state(j, state="running") j.remove() with pytest.raises(KeyError): jobs(jobID)
def testMergeRemoval(self): from Ganga.GPI import Job, Executable, Local, LocalFile, jobs # see Savannah 33710 j = Job() jobID = j.id # job will run for at least 20 seconds j.application = Executable(exe='sh', args=['-c', 'sleep 20; echo foo > out.txt']) j.backend = Local() j.outputfiles = [LocalFile('out.txt')] j.splitter = CopySplitter() j.postprocessors = MergerTester(files=['out.txt']) j.postprocessors[0].ignorefailed = True j.postprocessors[0].alwaysfail = True j.postprocessors[0].wait = 10 j.submit() run_until_state(j, state='running') j.remove() with pytest.raises(KeyError): jobs(jobID)
def test_AddSubmitRemove(self): from Ganga.GPI import Job j = Job() j.submit() j.remove()