Merge lp:~osomon/ubuntu-calendar-app/assert-today-is-today into lp:ubuntu-calendar-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 116
Merged at revision: 117
Proposed branch: lp:~osomon/ubuntu-calendar-app/assert-today-is-today
Merge into: lp:ubuntu-calendar-app
Diff against target: 31 lines (+11/-7)
1 file modified
tests/autopilot/calendar_app/tests/test_monthview.py (+11/-7)
To merge this branch: bzr merge lp:~osomon/ubuntu-calendar-app/assert-today-is-today
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+186105@code.launchpad.net

Commit message

Ensure that the current date is today before starting the tests.
This should fix a race condition whereby the current date was not initialized yet when the test was starting, resulting in broken assumptions.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Now I remember the issue with the original test Olivier :-) It hangs forever on the device. At least on my nexus 4, running the latest stable image.

review: Needs Fixing
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Ok, I take that back it eventually works, but it took a LONG time:

Ran 5 tests in 787.729s
OK

review: Approve
Revision history for this message
Olivier Tilloy (osomon) wrote :

> Ok, I take that back it eventually works, but it took a LONG time:
>
> Ran 5 tests in 787.729s
> OK

Wow. 13 minutes to run 5 tests, that’s unexpected. Have you observed the tests while running, and do you know what is taking so long?

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Yes, I observed them while running. The device hung for a long long time, then finished the tests normally. My guess is it's a dbus issue.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/calendar_app/tests/test_monthview.py'
--- tests/autopilot/calendar_app/tests/test_monthview.py 2013-09-16 10:28:33 +0000
+++ tests/autopilot/calendar_app/tests/test_monthview.py 2013-09-17 17:12:02 +0000
@@ -44,16 +44,20 @@
44 self.assertThat(lambda: self.get_currentDayStart().year,44 self.assertThat(lambda: self.get_currentDayStart().year,
45 Eventually(Equals(after.year)))45 Eventually(Equals(after.year)))
4646
47 def _assert_today(self):
48 today = datetime.today()
49 self.assertThat(lambda: self.get_currentDayStart().day,
50 Eventually(Equals(today.day)))
51 self.assertThat(lambda: self.get_currentDayStart().month,
52 Eventually(Equals(today.month)))
53 self.assertThat(lambda: self.get_currentDayStart().year,
54 Eventually(Equals(today.year)))
55
47 def _test_go_to_today(self, delta):56 def _test_go_to_today(self, delta):
48 start = self.get_currentDayStart()57 self._assert_today()
49 self.change_month(delta)58 self.change_month(delta)
50 self.main_view.open_toolbar().click_button("todaybutton")59 self.main_view.open_toolbar().click_button("todaybutton")
51 self.assertThat(lambda: self.get_currentDayStart().day,60 self._assert_today()
52 Eventually(Equals(start.day)))
53 self.assertThat(lambda: self.get_currentDayStart().month,
54 Eventually(Equals(start.month)))
55 self.assertThat(lambda: self.get_currentDayStart().year,
56 Eventually(Equals(start.year)))
5761
58 def test_monthview_go_to_today_next_month(self):62 def test_monthview_go_to_today_next_month(self):
59 self._test_go_to_today(1)63 self._test_go_to_today(1)

Subscribers

People subscribed via source and target branches

to status/vote changes: