0

我在 python 中对 AVC 进行了简单的测试,用于解锁设备并启动应用程序。该测试在无限循环中运行并且运行正常,但经过一段时间(一两个小时)后,我收到错误“闹钟”和“错误:超时”。看起来像:

start: 1401863215000
ERROR: timed out
sleep
Alarm clock
parser: 1401863215000

start、sleep 和 parser 消息是我的打印结果:

    print ("start: " + start)
    os.system('python satest.py > _LOGS/launch_log' + start + '.txt')

    print ("sleep")
    time.sleep(5)

    print ("parser: " + start)
    os.system('python parser.py')

有人可以建议错误可能在哪里吗?其他信息在github 上

这是我的一种方法:

def verify_view(view, delay, it):
    start = datetime.datetime.now()
    s = 0
    for counter in range(1,it):
        vc = ViewClient(*ViewClient.connectToDeviceOrExit())
        view_object = vc.findViewWithText(view)
        if (view_object is None):
            print("VERIFY: view - " + view + " not found")
            s = 2
            time.sleep(delay)
        else:
            print("VERIFY: view - " + view + " exists")
            s = 1
            break
    stop = datetime.datetime.now()
    global rest
    rest = stop - start
    print("VERIFY: verification time is: " + str(rest) + " seconds")
    if (s == 0):
        print("VERIFY: TEST ERROR, debug param 's' ==  " + str(s))
        return False
    if (s == 1):
        print("VERIFY: verification finished successfully, text - '" + view + "' was found")
        return True
    else:
        print("VERIFY: verification failed, there are no text - '" + view + "'")
        return False
4

0 回答 0