def testRunJobs(self):
            testPath = os.path.join(self.tempDir, "test.txt")

            job1 = self.batchSystem.issueBatchJob("sleep 1000", **defaultRequirements)
            job2 = self.batchSystem.issueBatchJob("sleep 1000", **defaultRequirements)

            issuedIDs = self._waitForJobsToIssue(2)
            self.assertEqual(set(issuedIDs), {job1, job2})

            runningJobIDs = self._waitForJobsToStart(2)
            self.assertEqual(set(runningJobIDs), {job1, job2})

            # Killing the jobs instead of allowing them to complete means this test can run very
            # quickly if the batch system issues and starts the jobs quickly.
            self.batchSystem.killBatchJobs([job1, job2])
            self.assertEqual({}, self.batchSystem.getRunningBatchJobIDs())

            # Issue a job and then allow it to finish by itself, causing it to be added to the
            # updated jobs queue.
            self.assertFalse(os.path.exists(testPath))
            job3 = self.batchSystem.issueBatchJob(testPath % "touch %s", **defaultRequirements)

            updatedID, exitStatus, wallTime = self.batchSystem.getUpdatedBatchJob(maxWait=1000)

            # Since the first two jobs were killed, the only job in the updated jobs queue should
            # be job 3. If the first two jobs were (incorrectly) added to the queue, this will
            # fail with updatedID being equal to job1 or job2.
            self.assertEqual(exitStatus, 0)
            self.assertEqual(updatedID, job3)
            if self.supportsWallTime():
                self.assertTrue(wallTime > 0)
            else:
                self.assertIsNone(wallTime)
            self.assertTrue(os.path.exists(testPath))
            self.assertFalse(self.batchSystem.getUpdatedBatchJob(0))

            # Make sure killBatchJobs can handle jobs that don't exist
            self.batchSystem.killBatchJobs([10])
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/test/batchSystems/batchSystemTest.py/hidden.AbstractBatchSystemTest.testRunJobs/swapped operands of `%`