Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 711a2f17 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "GD:Wait channel ready after stop/start server"

parents 053253c0 da961579
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@ import grpc


ANDROID_BUILD_TOP = os.environ.get('ANDROID_BUILD_TOP')
ANDROID_BUILD_TOP = os.environ.get('ANDROID_BUILD_TOP')
ANDROID_HOST_OUT = os.environ.get('ANDROID_HOST_OUT')
ANDROID_HOST_OUT = os.environ.get('ANDROID_HOST_OUT')
_WAIT_CHANNEL_READY_TIMEOUT = 10


def replace_vars(string, config):
def replace_vars(string, config):
    return string.replace("$ANDROID_HOST_OUT", ANDROID_HOST_OUT) \
    return string.replace("$ANDROID_HOST_OUT", ANDROID_HOST_OUT) \
@@ -86,6 +87,14 @@ class GdDeviceBase:
                          backing_process_return_code)
                          backing_process_return_code)
            return False
            return False


    def wait_channel_ready(self):
        future = grpc.channel_ready_future(self.grpc_channel)
        try:
          future.result(timeout=_WAIT_CHANNEL_READY_TIMEOUT)
        except grpc.FutureTimeoutError:
          logging.error("wait channel ready timeout")




class GdDeviceBaseLoggerAdapter(logging.LoggerAdapter):
class GdDeviceBaseLoggerAdapter(logging.LoggerAdapter):
    def process(self, msg, kwargs):
    def process(self, msg, kwargs):
+3 −0
Original line number Original line Diff line number Diff line
@@ -46,6 +46,9 @@ class SimpleHalTest(GdBaseTestClass):
            )
            )
        )
        )


        self.device_under_test.wait_channel_ready()
        self.cert_device.wait_channel_ready()

        self.device_under_test.hal.SendHciResetCommand(empty_pb2.Empty())
        self.device_under_test.hal.SendHciResetCommand(empty_pb2.Empty())
        self.cert_device.hal.SendHciResetCommand(empty_pb2.Empty())
        self.cert_device.hal.SendHciResetCommand(empty_pb2.Empty())