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
1=== modified file 'tests/autopilot/calendar_app/tests/test_monthview.py'
2--- tests/autopilot/calendar_app/tests/test_monthview.py 2013-09-16 10:28:33 +0000
3+++ tests/autopilot/calendar_app/tests/test_monthview.py 2013-09-17 17:12:02 +0000
4@@ -44,16 +44,20 @@
5 self.assertThat(lambda: self.get_currentDayStart().year,
6 Eventually(Equals(after.year)))
7
8+ def _assert_today(self):
9+ today = datetime.today()
10+ self.assertThat(lambda: self.get_currentDayStart().day,
11+ Eventually(Equals(today.day)))
12+ self.assertThat(lambda: self.get_currentDayStart().month,
13+ Eventually(Equals(today.month)))
14+ self.assertThat(lambda: self.get_currentDayStart().year,
15+ Eventually(Equals(today.year)))
16+
17 def _test_go_to_today(self, delta):
18- start = self.get_currentDayStart()
19+ self._assert_today()
20 self.change_month(delta)
21 self.main_view.open_toolbar().click_button("todaybutton")
22- self.assertThat(lambda: self.get_currentDayStart().day,
23- Eventually(Equals(start.day)))
24- self.assertThat(lambda: self.get_currentDayStart().month,
25- Eventually(Equals(start.month)))
26- self.assertThat(lambda: self.get_currentDayStart().year,
27- Eventually(Equals(start.year)))
28+ self._assert_today()
29
30 def test_monthview_go_to_today_next_month(self):
31 self._test_go_to_today(1)

Subscribers

People subscribed via source and target branches

to status/vote changes: