def test__performChecks(): pid = os.getpid() wd = Watchdog(pid, mock_exeThread, mock_spObject, 5000) res = wd.calibrate() assert res["OK"] is True res = wd._performChecks() assert res["OK"] is True
def test_performChecks(): wd = Watchdog(pid=os.getpid(), exeThread=MagicMock(), spObject=MagicMock(), jobCPUTime=1000, memoryLimit=1024 * 1024, jobArgs={'StopSigNumber': 10}) res = wd._performChecks() assert res['OK']
def __init__(self, pid, thread, spObject, jobCPUtime, memoryLimit=0, processors=1, systemFlag='linux'): """ Constructor, takes system flag as argument. """ Watchdog.__init__(self, pid, thread, spObject, jobCPUtime, memoryLimit, processors, systemFlag)
def __init__(self, pid, exeThread, spObject, jobCPUTime, memoryLimit=0, processors=1, systemFlag='mac', jobArgs={}): """ Constructor, takes system flag as argument. """ Watchdog.__init__(self, pid=pid, exeThread=exeThread, spObject=spObject, jobCPUTime=jobCPUTime, memoryLimit=memoryLimit, processors=processors, systemFlag=systemFlag, jobArgs=jobArgs)
def __init__( self, pid, exeThread, spObject, jobCPUTime, memoryLimit = 0, processors = 1, systemFlag = 'mac', jobArgs = {} ): """ Constructor, takes system flag as argument. """ Watchdog.__init__( self, pid = pid, exeThread = exeThread, spObject = spObject, jobCPUTime = jobCPUTime, memoryLimit = memoryLimit, processors = processors, systemFlag = systemFlag, jobArgs = jobArgs )
def __init__(self, pid, thread, spObject, jobCPUtime, memoryLimit=0, systemFlag='mac'): """ Constructor, takes system flag as argument. """ Watchdog.__init__(self, pid, thread, spObject, jobCPUtime, memoryLimit, systemFlag) self.systemFlag = systemFlag self.pid = pid
def test__performChecksFull(): pid = os.getpid() wd = Watchdog(pid, mock_exeThread, mock_spObject, 5000) wd.testCPULimit = 1 wd.testMemoryLimit = 1 res = wd.calibrate() assert res["OK"] is True res = wd._performChecks() assert res["OK"] is True
def __init__(self, pid, thread, spObject, jobCPUtime, memoryLimit = 0, systemFlag='linux'): """ Constructor, takes system flag as argument. """ Watchdog.__init__( self, pid, thread, spObject, jobCPUtime, memoryLimit, systemFlag ) self.systemFlag = systemFlag self.pid = pid
def test_calibrate(): pid = os.getpid() wd = Watchdog(pid, mock_exeThread, mock_spObject, 5000) res = wd.calibrate() assert res['OK'] is True