def __init__(self, optionMap, allApps): BaseActionRunner.__init__(self, optionMap, logging.getLogger("Queue System Submit")) # queue for putting tests when we couldn't reuse the originals self.reuseFailureQueue = Queue() self.testCount = 0 self.testsSubmitted = 0 self.maxCapacity = 100000 # infinity, sort of self.allApps = allApps for app in allApps: currCap = app.getConfigValue("queue_system_max_capacity") if currCap is not None and currCap < self.maxCapacity: self.maxCapacity = currCap self.jobs = OrderedDict() self.submissionRules = {} self.killedJobs = {} self.queueSystems = {} self.reuseOnly = False self.submitAddress = None self.slaveLogDirs = set() self.delayedTestsForAdd = [] self.remainingForApp = OrderedDict() capacityPerSuite = self.maxCapacity / len(allApps) for app in allApps: self.remainingForApp[app.name] = capacityPerSuite self.getQueueSystem(app) # populate cache QueueSystemServer.instance = self
def notifyAllComplete(self): BaseActionRunner.notifyAllComplete(self) errors = {} errorFiles = [] for logDir in self.slaveLogDirs: errorFiles += filter(os.path.getsize, glob(os.path.join(logDir, "*.errors"))) if len(errorFiles) == 0: return for fileName in errorFiles: contents = None # Take the shortest (i.e. most filtered) one for app in self.allApps: currContent = app.filterErrorText(fileName) if contents is None or len(currContent) < len(contents): contents = currContent if contents: errors[contents] = os.path.basename(fileName)[:-7] for msg, jobName in errors.items(): sys.stderr.write("WARNING: error produced by slave job '" + jobName + "'\n" + msg)
def __init__(self, optionMap, allApps): BaseActionRunner.__init__(self, optionMap, logging.getLogger("Queue System Submit")) # queue for putting tests when we couldn't reuse the originals self.reuseFailureQueue = Queue() self.counterLock = Lock() self.testCount = 0 self.testsSubmitted = 0 self.maxCapacity = 100000 # infinity, sort of self.allApps = allApps self.jobs = OrderedDict() self.submissionRules = {} self.killedJobs = {} self.queueSystems = {} self.reuseOnly = False self.submitAddress = None self.createDirectories = False self.slaveLogDirs = set() self.delayedTestsForAdd = [] self.remainingForApp = OrderedDict() for app in allApps: queueSystem = self.getQueueSystem(app) # populate cache queueCapacity = queueSystem.getCapacity() if queueSystem else None # If the slaves run somewhere else, they won't create directories for us if queueSystem: self.createDirectories |= queueSystem.slavesOnRemoteSystem() configCapacity = app.getConfigValue("queue_system_max_capacity") for currCap in [queueCapacity, configCapacity]: if currCap is not None and currCap < self.maxCapacity: self.maxCapacity = currCap if self.maxCapacity == 0: raise plugins.TextTestError, "The queue system module is reporting zero capacity.\nEither you have set 'queue_system_max_capacity' to 0 or something is uninstalled or unavailable. Exiting." capacityPerSuite = self.maxCapacity / len(allApps) for app in allApps: self.remainingForApp[app.name] = capacityPerSuite QueueSystemServer.instance = self
def notifyAllRead(self, suites): self.addDelayedTests() BaseActionRunner.notifyAllRead(self, suites)