Update test_create_new_alarm to wait for the alarm to trigger

RESOLVED FIXED

Status

defect
P2
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: zcampbell, Assigned: viorela)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Reporter

Description

5 years ago
This may be difficult or not worth it but let's try anyway..

To create parity with the manual smoke tests, update test_create_new_alarm.py to wait for the alarm to trigger.

After creating the alarm, kill the Clock app and wait for the alarm alert.

Update the test's name to suit.

Be very wary of any race condition between the trigger time of the alarm and the current time passing (which might mean the alarm would not trigger for 23hr 59 minutes). 

If you run into problems that mean the test code is too difficult,fragile or causes the test to take too long to run then please push back on this task.

This may be blocked by:
https://bugzilla.mozilla.org/show_bug.cgi?id=946130

Similarly using actions might be slow or unreliable so investigate other ways to set the alarm's time if need be.
Assignee

Updated

5 years ago
Assignee: nobody → viorela.ioia
Assignee

Comment 1

5 years ago
I've been investigating this bug and I have an idea. As we can't change the alarm time, I thought that we might change the time on the device.
After we set the alarm, we set the device time to be some seconds less than the current time. We can do that by using the set_time method from data_layer. Then we open Clock app, we disable the alarm and re-enable it. That way we will get the message that our alarm is set for less than a minute. 
The next step would be to close the Clock app and wait for the alarm to be triggered.
I'm not sure if this is a good way of modifying the test, as we need to add some extra steps.   
What do you think, Zac?
Flags: needinfo?(zcampbell)
Reporter

Comment 2

5 years ago
Good thinking Viorela. It sounds like you'll need to be very careful with the timing. Possibly turn off nitz (automatic time update) during the setUp and then some very thorough intermittent testing!

Can you do a proof of concept and make sure it works on both desktopb2g and device? If it doesn't work on desktopb2g it might be a blocker.
Flags: needinfo?(zcampbell)
Assignee

Updated

5 years ago
Depends on: 946130
Reporter

Updated

5 years ago
Depends on: 947317
No longer depends on: 946130
Assignee

Comment 3

5 years ago
Attachment #8420953 - Flags: review?(zcampbell)
Assignee

Updated

5 years ago
Duplicate of this bug: 944436
Reporter

Comment 5

5 years ago
Comment on attachment 8420953 [details] [review]
Github Pr: https://github.com/mozilla-b2g/gaia/pull/16826

r-, some changes to make
Attachment #8420953 - Flags: review?(zcampbell) → review-
Reporter

Comment 6

5 years ago
Viorela, can you try work on this again?
Flags: needinfo?(viorela.ioia)
Assignee

Comment 7

5 years ago
I updated the test, but it will fail at the end, because we still blocked by Bug 947317
Attachment #8420953 - Attachment is obsolete: true
Attachment #8475122 - Flags: review?(zcampbell)
Attachment #8475122 - Flags: review?(florin.strugariu)
Flags: needinfo?(viorela.ioia)
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

The code looks good but I have some concerns
Attachment #8475122 - Flags: review?(florin.strugariu) → review-
Reporter

Comment 9

5 years ago
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

I didn't run it so only f-, but I tihnk we should be sure we're setting the minutes reliably.
Attachment #8475122 - Flags: review?(zcampbell) → feedback-
Viorela any updates on this issue?
Flags: needinfo?(viorela.ioia)
Assignee

Comment 11

5 years ago
The PR is updated, but the test will fail at the end, because of Bug 947317. After closing the alarm frame, no code is executed.
Flags: needinfo?(viorela.ioia)
QA Whiteboard: [fxosqa-auto-backlog+]
Assignee

Updated

5 years ago
QA Whiteboard: [fxosqa-auto-backlog+] → [fxosqa-auto-backlog+][fxosqa-auto-s4]
Assignee

Updated

5 years ago
QA Whiteboard: [fxosqa-auto-backlog+][fxosqa-auto-s4] → [fxosqa-auto-s4]
Assignee

Comment 12

5 years ago
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

I updated the PR. The test is working as expected on device, but it is skipped on desktopb2g, as we cannot set the time.

I started an adhoc here: http://jenkins1.qa.scl3.mozilla.com/job/flame-kk.ui.adhoc/340/console

Please take a look over the changes. Thanks!
Attachment #8475122 - Attachment description: Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036 → Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files
Attachment #8475122 - Flags: review?(zcampbell)
Attachment #8475122 - Flags: review?(robert.chira)
Attachment #8475122 - Flags: review?(florin.strugariu)
Attachment #8475122 - Flags: review-
Reporter

Comment 13

5 years ago
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

It runs well but just needs the wait updated ;) ;)
Attachment #8475122 - Flags: review?(zcampbell) → review-
Assignee

Comment 14

5 years ago
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

waits are updated
Attachment #8475122 - Flags: review- → review?(zcampbell)
Attachment #8475122 - Flags: review?(robert.chira) → review+
Reporter

Comment 15

5 years ago
Comment on attachment 8475122 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/23036/files

New waits are good! R+
Attachment #8475122 - Flags: review?(zcampbell) → review+
Assignee

Updated

5 years ago
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Attachment #8475122 - Flags: review?(florin.strugariu) → review+
You need to log in before you can comment on or make changes to this bug.