Closed Bug 943313 Opened 11 years ago Closed 11 years ago

AttributeError: 'builtin_function_or_method' object has no attribute 'sleep' after adding power draw support

Categories

(Firefox OS Graveyard :: Gaia::UI Tests, defect, P1)

ARM
Gonk (Firefox OS)

Tracking

(firefox28 fixed, b2g-v1.2 fixed)

RESOLVED FIXED
Tracking Status
firefox28 --- fixed
b2g-v1.2 --- fixed

People

(Reporter: davehunt, Assigned: huseby)

Details

(Keywords: perf, Whiteboard: [c=power p= s= u=])

Attachments

(1 file)

46 bytes, text/x-github-pull-request
davehunt
: review+
Details | Review
It appears that the Yoctopuce library used to gather power draw data has cause an import issue with the standard Python module 'time'.

This can be replicated when the risks have been acknowledged but the warning is not skipped. This would usually delay for 30 seconds, but instead now fails.

$ GAIATEST_ACKNOWLEDGED_RISKS=true gaiatest --address=localhost:2828 gaiatest/tests/functional/browser/test_browser_navigation.py
...
The test run will continue in 30 seconds.
Traceback (most recent call last):
  File "/Users/dhunt/.virtualenvs/gaiatest/bin/gaiatest", line 9, in <module>
    load_entry_point('gaiatest==0.19', 'console_scripts', 'gaiatest')()
  File "/Users/dhunt/workspace/gaia/tests/python/gaia-ui-tests/gaiatest/runtests.py", line 391, in main
    cli(runner_class=GaiaTestRunner, parser_class=GaiaTestOptions)
  File "/Users/dhunt/workspace/mozilla/mozilla-central/testing/marionette/client/marionette/runtests.py", line 916, in cli
    runner = startTestRunner(runner_class, options, tests)
  File "/Users/dhunt/workspace/mozilla/mozilla-central/testing/marionette/client/marionette/runtests.py", line 907, in startTestRunner
    runner = runner_class(**vars(options))
  File "/Users/dhunt/workspace/gaia/tests/python/gaia-ui-tests/gaiatest/runtests.py", line 240, in __init__
    time.sleep(delay)

I believe this is due to the import in yocto_datalogger.py here: https://github.com/yoctopuce/yoctolib_python/blob/deee5e4413490dda06edf10c9c5be6e785344423/Sources/yocto_datalogger.py#L42

I think we can avoid this by only importing the items from the Yoctopuce modules that we need. Currently we have:

from yoctopuce.yocto_api import *
from yoctopuce.yocto_current import *
from yoctopuce.yocto_datalogger import *

We should try replacing this with:

from yoctopuce.yocto_api import YAPI
from yoctopuce.yocto_current import YCurrent
from yoctopuce.yocto_datalogger import YDataLogger

I do not have the necessary hardware to test that this works with the power draw testing.
:huseby could you have a look at this please?
yup, I'll take a look
Keywords: perf
Priority: -- → P1
Whiteboard: [c=power p= s= u=]
Status: NEW → ASSIGNED
Attached file pull request
Attachment #8339577 - Flags: review?(dave.hunt)
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: