GithubHelp home page GithubHelp logo

airtestproject / hrpc Goto Github PK

View Code? Open in Web Editor NEW
22.0 14.0 8.0 25 KB

Common interface definition based rpc implementation

License: Apache License 2.0

Python 100.00%
rpc rpc-framework rpc-library rpc-client

hrpc's People

Contributors

adolli avatar yimelia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hrpc's Issues

进行截图时异常

描述问题bug:
我使用 b64img, fmt = poco.snapshot(width=screen_size[1])进行截图时, 出现 hrpc.exceptions.RpcRemoteException 异常, 异常信息如下:

File "/usr/local/python3/lib/python3.7/site-packages/flybirds/core/plugin/plugins/default/screen.py", line 31, in screen_shot
   b64img, fmt = poco.snapshot(width=screen_size[1])
 File "/usr/local/python3/lib/python3.7/site-packages/poco/pocofw.py", line 433, in snapshot
   return self.agent.screen.getScreen(width)
 File "/usr/local/python3/lib/python3.7/site-packages/poco/drivers/android/uiautomation.py", line 75, in getScreen
   b64img = self.screen.getScreen(width)
 File "/usr/local/python3/lib/python3.7/site-packages/hrpc-1.0.9-py3.7.egg/hrpc/object_proxy.py", line 92, in __call__
   return self._client__.evaluate(self.__call_no_evaluate__(remote_obj_cache, *args))
 File "/usr/local/python3/lib/python3.7/site-packages/hrpc-1.0.9-py3.7.egg/hrpc/client.py", line 81, in evaluate
   raise RpcRemoteException(resp)
hrpc.exceptions.RpcRemoteException: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getHeight()' on a null object reference

|--   Remote Traceback   --|

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getHeight()' on a null object reference
   at com.netease.open.pocoservice.Screen.getScreen(Screen.java:40)
   at java.lang.reflect.Method.invoke(Native Method)
   at com.netease.open.hrpc.backend.RpcServer.onRequest(RpcServer.java:171)
   at com.netease.open.hrpc.backend.RpcServer.serve(RpcServer.java:57)
   at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:840)
   at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:189)
   at java.lang.Thread.run(Thread.java:920)


|--   Remote Traceback end   --|

python 版本: python3.7

pocoui版本: 1.0.85

hrpc 版本: 1.0.9

设备:

  • 型号: [谷歌原生模拟器]
  • 系统: [ANDROID26(8.0)]

运行截图时报错

INTERNALERROR>   File "/Users/test/Project_pytest/new_auto_test/test-app-autotest/conftest.py", line 88, in capture_screenshot
INTERNALERROR>     screenshot, fmt = poco.snapshot(width=720)
INTERNALERROR>   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/poco/pocofw.py", line 433, in snapshot
INTERNALERROR>     return self.agent.screen.getScreen(width)
INTERNALERROR>   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/poco/drivers/android/uiautomation.py", line 73, in getScreen
INTERNALERROR>     b64img = self.screen.getScreen(width)
INTERNALERROR>   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/hrpc/object_proxy.py", line 92, in __call__
INTERNALERROR>     return self._client__.evaluate(self.__call_no_evaluate__(remote_obj_cache, *args))
INTERNALERROR>   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/hrpc/client.py", line 81, in evaluate
INTERNALERROR>     raise RpcRemoteException(resp)
INTERNALERROR> hrpc.exceptions.RpcRemoteException: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getHeight()' on a null object reference

hrpc.exceptions.RpcRemoteException 异常,并且又涉及到了android.graphics.Bitmap.getHeight()错误,希望解决。

关于长时间运行卡主问题:hrpc与pocoservice通信

而且一般是卡在hrpc/object_proxy.py对象析构的时候

def __del__(self):
        # 代理对象析构时,请求远程对象也析构,并不需要等待返回
        if self._is_intermediate_uri__:
            action = (('del', ()), )
            self._client__.evaluate(RpcObjectProxy(self._uri__, self._client__, action), wait_for_response=False)

请求报文:

{"id": "", "uri": "[Lcom.netease.open.libpoco.sdk.AbstractNode;@184e8ec(61762182-3f08-4bbd-b836-49eddbe95f46)", "method": [["del", []]], "session_id": "3e6b0bdb-90a6-4dab-892c-3f3bac49f904"}

Exception ignored in: <function RpcObjectProxy.del at 0x1234687a0>
Traceback (most recent call last):
File "/Users/xs/PycharmProjects/airtest/hrpc/object_proxy.py", line 114, in del
self.client_.evaluate(RpcObjectProxy(self.uri_, self.client_, action), wait_for_response=False)
File "/Users/xs/PycharmProjects/airtest/hrpc/client.py", line 64, in evaluate
self.transport.send({'id': reqid, 'uri': obj_proxy.uri_, 'method': obj_proxy.invocation_path_})
File "/Users/xs/PycharmProjects/airtest/hrpc/transport/http.py", line 31, in send
raise TransportDisconnected(e)
hrpc.exceptions.TransportDisconnected: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.