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

Commit f4ff362d authored by Chienyuan's avatar Chienyuan Committed by android-build-merger
Browse files

Merge "GD:Wait channel ready after stop/start server" am: 711a2f17 am: ad57a8ed am: 66996711

am: 0f4e4bf8

Change-Id: I2c96df7c28a96c079198206bf0ccebc5e248d0e5
parents fa186954 0f4e4bf8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import grpc

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

def replace_vars(string, config):
    return string.replace("$ANDROID_HOST_OUT", ANDROID_HOST_OUT) \
@@ -86,6 +87,14 @@ class GdDeviceBase:
                          backing_process_return_code)
            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):
    def process(self, msg, kwargs):
+3 −0
Original line number 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.cert_device.hal.SendHciResetCommand(empty_pb2.Empty())