Skip to content

Commit 4ba885c

Browse files
author
vhristov5555
committed
Try to fix reboot problem in Perf tests by killing and starting the adb server.
1 parent 0b98b79 commit 4ba885c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

core/device/helpers/adb.py

+14
Original file line numberDiff line numberDiff line change
@@ -407,3 +407,17 @@ def reboot_device(device_id):
407407
output = Adb.run(command=command, device_id=device_id)
408408
assert '' in output, 'Failed to reboot the device.Error:' + output
409409
print 'Reboot started successfully.'
410+
411+
@staticmethod
412+
def kill_server():
413+
command = 'kill-server'
414+
output = run(ADB_PATH + ' ' + command)
415+
assert '' in output, 'Failed to kill server the device.Error:' + output
416+
print 'Kill server successfully.'
417+
418+
@staticmethod
419+
def start_server():
420+
command = 'start-server'
421+
output = run(ADB_PATH + ' ' + command)
422+
assert 'daemon started successfully' in output, 'Failed to start the server.Error:' + output
423+
print 'Start server successfully.'

tests/perf/start_time.py

+2
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ def test_start_time(self, demo, config, device_name, device_id, first_start, sec
181181
second_start_expected = second_start
182182
Adb.reboot_device(self.DEVICE_ID)
183183
Emulator.wait(self.DEVICE_ID)
184+
Adb.kill_server()
185+
Adb.start_server()
184186

185187
start_time_actual = 0
186188
second_start_actual = 0

0 commit comments

Comments
 (0)