Merge lp://staging/~mvo/software-center/dbus-idle-timeout into lp://staging/software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3217
Proposed branch: lp://staging/~mvo/software-center/dbus-idle-timeout
Merge into: lp://staging/software-center
Diff against target: 219 lines (+113/-8)
3 files modified
software-center-dbus (+3/-1)
softwarecenter/db/dataprovider.py (+63/-6)
tests/test_dataprovider.py (+47/-1)
To merge this branch: bzr merge lp://staging/~mvo/software-center/dbus-idle-timeout
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+127208@code.staging.launchpad.net

Description of the change

This branch addresses bug #1058567 to ensure that the data provider
exits after a certain amount of time.

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hi Michael, thanks for your branch! Strangely, I'm getting a bunch of errors when I run the associated unit test, test_dataprovider.py, as shown at the following pastebin:

  http://paste.ubuntu.com/1255206/

I'm not seeing these errors in current trunk. Do you have an idea about why I might be seeing these?

Many thanks!

3212. By Michael Vogt

move implementation of the dbus methods into a seperate function so that we can add decorators - the dbus.service.method decorator seems to not like additional decroators

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, indeed, it looks like the dbus decorator does not like other decorators at the same time. I fixed this now and the tests work now on my box.

Revision history for this message
Michael Vogt (mvo) wrote :

Anything holding this one back?

Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hi Michael, I'm sorry for the delay on this one! Ok, I just tried it and I'm still getting an error in the test. It seems that SoftwareCenterDataProvider's __init__ doesn't like the Mock self.IDLE_CHECK_INTERVAL being passed into the GObject.timeout_add_seconds() that happens in test_idle_timeout:

======================================================================
ERROR: test_idle_timeout (__main__.IdleTimeoutTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_dataprovider.py", line 195, in test_idle_timeout
    self.bus_name, main_loop=self.loop)
  File "/home/tremolux/Projects/quantal/software-center_review_mvo_dbus_idle_timeout/dbus-idle-timeout/softwarecenter/db/dataprovider.py", line 89, in __init__
    self.IDLE_CHECK_INTERVAL, self._check_inactivity)
TypeError: an integer is required

----------------------------------------------------------------------
Ran 15 tests in 8.076s

FAILED (errors=1)

Revision history for this message
Gary Lasker (gary-lasker) wrote :

Note that the above is when testing on Precise. I'll try this on a Quantal machine and see if I still get the error.

Revision history for this message
Gary Lasker (gary-lasker) wrote :

Meanwhile I will approve this as the only issue is the failing test case. Michael, please feel free to merge this branch when the test is ready.

Thanks!

review: Approve
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for the review, I just double checked, it fails on precise for me as well but works on quantal.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches