Closed Bug 1003239 Opened 10 years ago Closed 10 years ago

ADBDeviceHandler does not set time on Android 2.3 or Android x86 emulators

Categories

(Release Engineering :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file)

The Android 2.3 and Android x86 emulator jobs use ADBDeviceHandler.set_device_time to execute 'date' on the device, but it always reports a failure.

https://tbpl.mozilla.org/php/getParsedLog.php?id=38527699&tree=Ash&full=1

17:01:42     INFO - Running command: ['/tools/android-sdk18/platform-tools/adb', '-s', 'emulator-5554', 'shell', 'date', '1398470501.97']
17:01:42     INFO - Copy/paste: /tools/android-sdk18/platform-tools/adb -s emulator-5554 shell date 1398470501.97
17:01:42     INFO -  time 1398470501.97 -> 1398470501.0
17:01:42     INFO -  settimeofday failed Invalid argument
17:01:42     INFO - Return code: 0

This isn't of much concern since the emulator inherits the host's time, and seems to keep accurate time anyway:

17:01:42     INFO - Getting output from command: ['/tools/android-sdk18/platform-tools/adb', '-s', 'emulator-5554', 'shell', 'date']
17:01:42     INFO - Copy/paste: /tools/android-sdk18/platform-tools/adb -s emulator-5554 shell date
17:01:42     INFO - Reading from file tmpfile_stdout
17:01:42     INFO - Output received:
17:01:42     INFO -  Sat Apr 26 00:01:41 GMT 2014

Still it seems a shame to keep executing failing code, and I wonder if this might be affecting bug 993146, an intermittent hang during the install step.

I think "date +1398470501" (leading plus, no fraction) is more correct...but it does not seem to on the emulator either. 

Using YYYYMMDD.hhmmss format does seem to work though:

# date
Tue Apr 29 08:08:10 PDT 2014
# date -s 20140429.101400
Tue Apr 29 10:14:00 PDT 2014
# date
Tue Apr 29 10:14:01 PDT 2014
Tested on ash...

https://tbpl.mozilla.org/php/getParsedLog.php?id=38735306&tree=Ash&full=1

12:53:35     INFO - Installing Fennec for test-1
12:53:35     INFO - Getting output from command: ['/tools/android-sdk18/platform-tools/adb', '-s', 'emulator-5554', 'shell', 'date']
12:53:35     INFO - Copy/paste: /tools/android-sdk18/platform-tools/adb -s emulator-5554 shell date
12:53:35     INFO - Reading from file tmpfile_stdout
12:53:35     INFO - Output received:
12:53:35     INFO -  Tue Apr 29 12:53:34 PDT 2014
12:53:35     INFO - retry: Calling <built-in function remove> with args: ('tmpfile_stderr',), kwargs: {}, attempt #1
12:53:35     INFO - retry: Calling <built-in function remove> with args: ('tmpfile_stdout',), kwargs: {}, attempt #1
12:53:35     INFO - Tue Apr 29 12:53:34 PDT 2014
12:53:35     INFO - Running command: ['/tools/android-sdk18/platform-tools/adb', '-s', 'emulator-5554', 'shell', 'date', '-s', '20140429.125335']
12:53:35     INFO - Copy/paste: /tools/android-sdk18/platform-tools/adb -s emulator-5554 shell date -s 20140429.125335
12:53:35     INFO -  Tue Apr 29 12:53:35 PDT 2014
12:53:35     INFO - Return code: 0
12:53:35     INFO - Getting output from command: ['/tools/android-sdk18/platform-tools/adb', '-s', 'emulator-5554', 'shell', 'date']
12:53:35     INFO - Copy/paste: /tools/android-sdk18/platform-tools/adb -s emulator-5554 shell date
12:53:35     INFO - Reading from file tmpfile_stdout
12:53:35     INFO - Output received:
12:53:35     INFO -  Tue Apr 29 12:53:35 PDT 2014
12:53:35     INFO - retry: Calling <built-in function remove> with args: ('tmpfile_stderr',), kwargs: {}, attempt #1
12:53:35     INFO - retry: Calling <built-in function remove> with args: ('tmpfile_stdout',), kwargs: {}, attempt #1
12:53:35     INFO - Tue Apr 29 12:53:35 PDT 2014
Attachment #8414732 - Flags: review?(kmoir)
Attachment #8414732 - Flags: review?(kmoir) → review+
Verified in production: https://tbpl.mozilla.org/php/getParsedLog.php?id=38880943&tree=Mozilla-Inbound&full=1

10:22:14     INFO - Running command: ['/tools/android-sdk18/platform-tools/adb', '-s', 'emulator-5554', 'shell', 'date', '-s', '20140501.102214']
10:22:14     INFO - Copy/paste: /tools/android-sdk18/platform-tools/adb -s emulator-5554 shell date -s 20140501.102214
10:22:14     INFO -  Thu May  1 10:22:14 PDT 2014
10:22:14     INFO - Return code: 0
10:22:14     INFO - Getting output from command: ['/tools/android-sdk18/platform-tools/adb', '-s', 'emulator-5554', 'shell', 'date']
10:22:14     INFO - Copy/paste: /tools/android-sdk18/platform-tools/adb -s emulator-5554 shell date
10:22:14     INFO - Reading from file tmpfile_stdout
10:22:14     INFO - Output received:
10:22:14     INFO -  Thu May  1 10:22:14 PDT 2014
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Component: General Automation → General
You need to log in before you can comment on or make changes to this bug.