Example #1
0
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
Example #2
0
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']
Example #3
0
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