在執行 appium 時,發現程式一直卡在 adb /proc/net/unix, 一直待到 adb 超時才結束

Forkey發表於2020-10-29

相關資訊:

npm版本: 3.9.0,
appium server版本: 1.14.0
手機: 華為 nova7 Pro 5G
app架構: 原生外殼 + H5

appium引數配置資訊:

desired_caps = {
'platformName': self.platform_name,
'platformVerion': self.device_info['platform_version'],
'udid': self.device_info["udid"],
"deviceName": self.device_info["udid"],
'noReset': True,
'appPackage': self.app_package,
'appActivity': self.app_activity,
"unicodeKeyboard": True,
"reset_keyboard": True,
'automationName': UiAutomator2,
'chromedriverExecutable': self.chrome_driver_path,
'chromeOptions': {'androidProcess': self.app_package},
"systemPort": int(self.device_info["systemPort"]),
"autoWebview": True,
'adbExecTimeout': 200000
}

執行pytest

def main(device_info):
pytest.main(
["--device_info={}".format(device_info),
"cases/xxxxx.py",
"--alluredir", "./result", "-vs"])
os.system('allure generate result/ -o report/ --clean')


if __name__ == "__main__":
for num in range(20):
with Pool(len(device_infos)) as pool:
pool.map(main, device_infos)
pool.close()
pool.join()

APPIUM相關日誌:

[debug] [35m[ADB][39m Running 'E:\android-sdk\platform-tools\adb.exe -P 5037 -s UJKDU20611008827 shell cat /proc/net/unix'
[35m[HTTP][39m [37m<-- GET /wd/hub/session/b511eb04-9972-4a2d-b4b3-7600841a1cb8/contexts [39m[32m-[39m [90m- ms - -[39m
[35m[HTTP][39m [90m[39m
[35m[HTTP][39m [37m-->[39m [37mGET[39m [37m/wd/hub/session/b511eb04-9972-4a2d-b4b3-7600841a1cb8/contexts[39m
[35m[HTTP][39m [90m{}[39m
[debug] [35m[W3C (b511eb04)][39m Calling AppiumDriver.getContexts() with args: ["b511eb04-9972-4a2d-b4b3-7600841a1cb8"]
[debug] [35m[AndroidDriver][39m Getting a list of available webviews
[debug] [35m[ADB][39m Running 'E:\android-sdk\platform-tools\adb.exe -P 5037 -s UJKDU20611008827 shell cat /proc/net/unix'
[debug] [35m[W3C (b511eb04)][39m Encountered internal error running command: Error executing adbExec. Original error: 'Command 'E\:\\android-sdk\\platform-
tools\\adb.exe -P 5037 -s UJKDU20611008827 shell cat /proc/net/unix' timed out after 200000ms'. Try to increase the 200000ms adb execution timeout represented by
'adbExecTimeout' capability
[debug] [35m[W3C (b511eb04)][39m Error: Command 'E\:\\android-sdk\\platform-tools\\adb.exe -P 5037 -s UJKDU20611008827 shell cat /proc/net/unix' timed out after 200000ms
[debug] [35m[W3C (b511eb04)][39m at Timeout._onTimeout (C:\Users\zhangfuqiang\AppData\Roaming\npm\node_modules\appium\node_modules\teen_process\lib\exec.js:112:19)
[debug] [35m[W3C (b511eb04)][39m at listOnTimeout (internal/timers.js:531:17)
[debug] [35m[W3C (b511eb04)][39m at processTimers (internal/timers.js:475:7)

相關文章