Closed
Bug 689316
Opened 13 years ago
Closed 13 years ago
DeviceManagerADB needs a getCurrentTime function
Categories
(Testing :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla10
People
(Reporter: wlach, Assigned: wlach)
Details
(Whiteboard: [inbound])
Attachments
(2 files, 5 obsolete files)
883 bytes,
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
762 bytes,
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
This is needed for remote talos to work correctly when running the ts:gfx (and possibly other things as well)
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #562545 -
Flags: review?(jmaher)
Assignee | ||
Comment 2•13 years ago
|
||
This is the same as the m-c, except it should work for talos too
Assignee | ||
Updated•13 years ago
|
Attachment #562548 -
Flags: review?(jmaher)
Comment 3•13 years ago
|
||
Comment on attachment 562545 [details] [diff] [review] Patch to add getCurrentTime to devicemanagerADB in mozilla-central Review of attachment 562545 [details] [diff] [review]: ----------------------------------------------------------------- ::: build/mobile/devicemanagerADB.py @@ +457,5 @@ > + def getCurrentTime(self): > + timestr = self.runCmd(["shell", "date", "+%s"]).stdout.read() > + if (not timestr or not timestr.isdigit()): > + raise DMError("Error getting time") > + return float(timestr)*1000 in devicemanagerSUT, we return a int, not a float. This is what we return from devicemanagerSUT: 1317119656911 and I see 'shell date + %s' returning: 1317119669 So the '*1000' is needed, but not adding a .0 at the end.
Attachment #562545 -
Flags: review?(jmaher) → review-
Assignee | ||
Comment 4•13 years ago
|
||
So if we changed "return float(timestr)*1000" to "return int(timestr)*1000", we'd be good?
Assignee | ||
Comment 5•13 years ago
|
||
Ok, the patch had some problems anyway. Fixing...
Assignee | ||
Comment 6•13 years ago
|
||
This corrects 3 problems: * Shouldn't convert to float. Time should be an integer * Should return as string (as that's what the sut method does and some things depend on that) * Need to strip out whitespace from what the shell returns
Attachment #562545 -
Attachment is obsolete: true
Assignee | ||
Comment 7•13 years ago
|
||
This corrects 3 problems: * Shouldn't convert to float. Time should be an integer * Should return as string (as that's what the sut method does and some things depend on that) * Need to strip out whitespace from what the shell returns
Attachment #562548 -
Attachment is obsolete: true
Attachment #562548 -
Flags: review?(jmaher)
Attachment #562870 -
Flags: review?(jmaher)
Assignee | ||
Updated•13 years ago
|
Attachment #562869 -
Flags: review?(jmaher)
Comment 8•13 years ago
|
||
Comment on attachment 562869 [details] [diff] [review] Take #2 of patch to add currentTime method to deviceManagerADB in m-c Review of attachment 562869 [details] [diff] [review]: ----------------------------------------------------------------- r- for the raising of an exception. If this was an internal method I would be fine with the exception. ::: build/mobile/devicemanagerADB.py @@ +452,5 @@ > + > + # external function > + # returns: > + # success: time in ms > + # failure: None This return value doesn't match the failure case below @@ +456,5 @@ > + # failure: None > + def getCurrentTime(self): > + timestr = self.runCmd(["shell", "date", "+%s"]).stdout.read().strip() > + if (not timestr or not timestr.isdigit()): > + raise DMError("Error getting time") I would prefer we return -1 or None here. It is not guaranteed that all code will catch exceptions and this has bitten us pretty badly on the automation system.
Attachment #562869 -
Flags: review?(jmaher) → review-
Assignee | ||
Comment 9•13 years ago
|
||
Assignee: nobody → wlachance
Attachment #562869 -
Attachment is obsolete: true
Attachment #563508 -
Flags: review?(jmaher)
Assignee | ||
Comment 10•13 years ago
|
||
Attachment #562870 -
Attachment is obsolete: true
Attachment #562870 -
Flags: review?(jmaher)
Attachment #563510 -
Flags: review?(jmaher)
Comment 11•13 years ago
|
||
Comment on attachment 563508 [details] [diff] [review] Take #3 of patch to add currentTime method to deviceManagerADB in m-c Review of attachment 563508 [details] [diff] [review]: ----------------------------------------------------------------- thanks!
Attachment #563508 -
Flags: review?(jmaher) → review+
Comment 12•13 years ago
|
||
Comment on attachment 563510 [details] [diff] [review] Take #3 of patch to add currentTime method to deviceManagerADB in talos Review of attachment 563510 [details] [diff] [review]: ----------------------------------------------------------------- r=me with the s/float/int/ ::: devicemanagerADB.py @@ +457,5 @@ > + def getCurrentTime(self): > + timestr = self.runCmd(["shell", "date", "+%s"]).stdout.read().strip() > + if (not timestr or not timestr.isdigit()): > + return None > + return str(float(timestr)*1000) this has a float, not an int()
Assignee | ||
Comment 13•13 years ago
|
||
float->int
Attachment #563510 -
Attachment is obsolete: true
Attachment #563510 -
Flags: review?(jmaher)
Attachment #563521 -
Flags: review?(jmaher)
Comment 14•13 years ago
|
||
Comment on attachment 563521 [details] [diff] [review] Take #4 of patch to add currentTime method to deviceManagerADB in talos Review of attachment 563521 [details] [diff] [review]: ----------------------------------------------------------------- in the future if I r+, you can carry over the r+ as long as you have addressed any nits or changes I asked for.
Attachment #563521 -
Flags: review?(jmaher) → review+
Assignee | ||
Comment 15•13 years ago
|
||
Cool, noted. Can you land these for me?
Comment 16•13 years ago
|
||
landed on inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/e87bbd84ba87
Whiteboard: [inbound]
Comment 17•13 years ago
|
||
talos: http://hg.mozilla.org/build/talos/rev/87f57c5b5d7e
Comment 18•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e87bbd84ba87
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in
before you can comment on or make changes to this bug.
Description
•