From f013301253a29ded4a2bfaf3258ec92bff64ef69 Mon Sep 17 00:00:00 2001 From: Andrew Erickson Date: Wed, 18 Dec 2019 16:03:09 -0800 Subject: [PATCH 1/2] handle an exception generated in a debug message --- taskcluster/script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taskcluster/script.py b/taskcluster/script.py index 3f5177d..e04a4b4 100755 --- a/taskcluster/script.py +++ b/taskcluster/script.py @@ -55,11 +55,11 @@ def get_device_type(device): def enable_charging(device, device_type): - print("script.py: enabling charging for device '%s' ('%s')..." % (device_type, device.get_info('id')['id'])) p2_path = "/sys/class/power_supply/battery/input_suspend" g5_path = "/sys/class/power_supply/battery/charging_enabled" try: + print("script.py: enabling charging for device '%s' ('%s')..." % (device_type, device.get_info('id')['id'])) if device_type == "Pixel 2": p2_charging_disabled = ( device.shell_output( From fbca63e5ae58e1e90e0142f6cee94712188e331c Mon Sep 17 00:00:00 2001 From: Andrew Erickson Date: Thu, 19 Dec 2019 17:20:29 -0600 Subject: [PATCH 2/2] failure to enable charging is problematic, but don't fail the job --- taskcluster/script.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/taskcluster/script.py b/taskcluster/script.py index e04a4b4..ecc9bdc 100755 --- a/taskcluster/script.py +++ b/taskcluster/script.py @@ -88,11 +88,9 @@ def enable_charging(device, device_type): pass else: fatal("Unknown device ('%s')! Contact Android Relops immediately." % device_type, retry=False) - except ADBError as e: - fatal("Failed to enable charging. Contact Android Relops immediately.", exception=e, retry=False) - except ADBTimeoutError as e: + except (ADBError, ADBTimeoutError) as e: print( - "TEST-WARNING | bitbar | Timed out trying to enable charging." + "TEST-WARNING | bitbar | Error while attempting to enable charging." ) print("{}: {}".format(e.__class__.__name__, e))