Пример #1
0
    def test_AddRemove(self):
        from Ganga.GPI import Job, jobs

        j = Job()
        assert(len(jobs) == 1)
        j.remove()
        assert(len(jobs) == 0)
Пример #2
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()
Пример #3
0
 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 + '/..' ) ) )
Пример #4
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()
Пример #5
0
    def test_AddRemove(self):
        from Ganga.GPI import Job, jobs

        j = Job()
        assert (len(jobs) == 1)
        j.remove()
        assert (len(jobs) == 0)
Пример #6
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 + '/..')))
Пример #7
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 + '/..')))
Пример #8
0
    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()
Пример #9
0
    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()
Пример #10
0
    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)
Пример #11
0
    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)
Пример #12
0
    def test_AddSubmitRemove(self):
        from Ganga.GPI import Job

        j = Job()
        j.submit()
        j.remove()
Пример #13
0
    def test_AddSubmitRemove(self):
        from Ganga.GPI import Job

        j = Job()
        j.submit()
        j.remove()