New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TBD] Failed to shutdown sl4a event dispatcher. #748
Comments
I'd avoid using sl4a. Please use Mobly snippets instead. |
I create below test case and configuration to deal with this issue:
import logging
import pprint
from mobly import asserts
from mobly import base_test
from mobly import test_runner
from mobly.controllers import android_device
from mobly.controllers.android_device_lib.services import sl4a_service
class HelloWorldTest(base_test.BaseTestClass):
'''
See: https://github.com/johnklee/mobly/blob/master/docs/tutorial.md#example-4-multiple-test-beds-and-default-test-parameters
'''
def setup_class(self):
# Registering android_device controller module, and declaring that the test
# requires at least two Android devices.
self.ads = self.register_controller(android_device)
# The device used to discover Bluetooth devices.
self.dut = android_device.get_device(self.ads, label='dut')
# Sets the tag that represents this device in logs.
self.dut.debug_tag = 'dut'
# Setup MBS (Mobly Bundled Snippet)
self.dut.load_snippet(
'mbs',
'com.google.android.mobly.snippet.bundled'
)
# New: Register SL4A service
self.dut.services.register('sl4a', sl4a_service.Sl4aService)
def setup_test(self):
# Make sure bluetooth is on.
self.dut.mbs.btEnable()
# Set Bluetooth name on target device.
self.dut.mbs.btSetName('IamDUT')
def teardown_test(self):
# Turn Bluetooth off on both devices after test finishes.
self.dut.mbs.btDisable()
if __name__ == '__main__':
test_runner.main()
MoblyParams: {LogPath: /tmp/}
TestBeds:
# A test bed where adb will find Android devices.
- Name: SampleTestBed
Controllers:
AndroidDevice:
- serial: 07311JECB08252
label: dut
TestParams:
search_bluetooth_name: JohnPixel I add debugging message and obtain below log message: # python i748.py -c i748_config.yaml
[SampleTestBed] 05-20 05:08:12.899 INFO Test output folder: "/tmp/SampleTestBed/05-20-2021_05-08-12-898"
[SampleTestBed] 05-20 05:08:12.901 INFO ==========> HelloWorldTest <==========
[SampleTestBed] 05-20 05:08:18.750 INFO [AndroidDevice|07311JECB08252] Logging debug tag set to "dut"
[SampleTestBed] 05-20 05:08:20.840 INFO [AndroidDevice|dut] Launching snippet apk com.google.android.mobly.snippet.bundled with protocol 1.0
[10|jsonrpc_client_base|227] Connecting localhost on port=20363
[10|sl4a_service|40] Start service...
[10|jsonrpc_client_base|227] Connecting localhost on port=17019
[10|jsonrpc_client_base|227] Connecting localhost on port=17019
[10|sl4a_client|162] Start event client with host_port=17019; device_port=8080
[10|jsonrpc_client_base|227] Connecting localhost on port=17019
[30|jsonrpc_client_base|272] clear host port of JspRPC(17019)...
[30|jsonrpc_client_base|272] clear host port of JspRPC(17019)...
[30|jsonrpc_client_base|272] clear host port of JspRPC(20363)...
[SampleTestBed] 05-20 05:08:29.047 INFO Summary for test class HelloWorldTest: Error 0, Executed 0, Failed 0, Passed 0, Requested 0, Skipped 0
[SampleTestBed] 05-20 05:08:29.049 INFO Summary for test run SampleTestBed@05-20-2021_05-08-12-898: Error 0, Executed 0, Failed 0, Passed 0, Requested 0, Skipped 0 For somehow, the host port If it makes sense here, I will create a PR as well. Many thanks! (Two failed test cases found. I will fix them if this solution is accepted.)
|
Failed test cases are fixed in below commit: |
There are a lot of bug fixes in the sl4a client in the AOSP repo. |
Understood. Thanks for the update. |
Hi @xpconanfan , |
We have decided to deprecate sl4a support as Mobly snippets can now be used in AOSP repo to gain the same level of access without all the legacy problems of sl4a |
I can follow Mobly101 to execute
$ python hello_world_test.py -c sample_config.yml
without issue. But when I updatedhello_world_test.py
to register SL4J service as below:I will get below error:
May need some time to dig in to collect more information. Thanks!
The text was updated successfully, but these errors were encountered: