OHOS CI: Abort early when speedometer crashes in test-speedometer-ohos (#39511)

Check for the pid of servo for test-speedometer-ohos to see if it did
not crash and abort early if it crashed.

Testing: Ran test-speedometer-ohos with closing servo and without
closing servo on the phone.
Fixes: https://github.com/servo/servo/issues/37742

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
Narfinger 2025-10-01 10:41:07 +02:00 committed by GitHub
parent 5510ea91b3
commit f4c618924f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -700,7 +700,15 @@ class MachCommands(CommandBase):
except OSError:
return ""
subprocess.call([hdc_path, "shell", "aa", "force-stop", "org.servo.servo"])
subprocess.call(
[
hdc_path,
"shell",
"aa",
"force-stop",
"org.servo.servo",
]
)
subprocess.call([hdc_path, "shell", "rm", log_path])
subprocess.call(
@ -737,6 +745,9 @@ class MachCommands(CommandBase):
sleep(2)
whole_file = read_log_file(hdc_path)
break
if not subprocess.check_output([hdc_path, "shell", "pidof", "org.servo.servo"]):
print("Servo crashed, aborting speedometer test")
exit(1)
else:
print("Error failed to find console logs in log file")
print(f"log-file contents: `{whole_file}`")