Closed Bug 1244818 Opened 9 years ago Closed 3 months ago

Icaljs failure on first day of the month | TEST-UNEXPECTED-FAIL | xpcshell-icaljs.ini:calendar/test/unit/test_alarmservice.js

Categories

(Calendar :: ICAL.js Integration, defect)

Lightning 4.9
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: ssitter, Unassigned)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file, 2 obsolete files)

TEST-UNEXPECTED-FAIL | xpcshell-icaljs.ini:calendar/test/unit/test_alarmservice.js https://treeherder.mozilla.org/logviewer.html#?job_id=22848&repo=comm-aurora This test case fails sporadically for icaljs but not for libical. Failure seems to happen if test is executed on the first day of the month. I can reproduce this on Windows by setting the date before running the test: date: Sun Jan 31 19:12:31 GMT 2016 -> test pass date: Mon Feb 1 19:13:38 GMT 2016 -> test fail date: Tue Feb 2 19:15:13 GMT 2016 -> test pass date: Mon Feb 29 19:16:23 GMT 2016 -> test pass date: Tue Mar 1 19:17:26 GMT 2016 -> test fail date: Wed Mar 2 19:19:21 GMT 2016 -> test pass
One of the items used in the test is a monthly repeating event, it fails with ical.js when the system date is the first of the month due to Bug 1103187, one of the incorrect occurrences falls within the alarm service timer range when it shouldn't.
Depends on: 1103187
I think I am seeing this today. https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&selectedJob=22089 TEST-UNEXPECTED-FAIL | xpcshell-icaljs.ini:calendar/test/unit/test_alarmservice.js | xpcshell return code: 0 1239148 Permanent debug test_alarmservice.js | xpcshell return code: 1 | application crashed [@ js::TypeFailure(JSContext *,char const *,...)] 1261688 libical failure on first day of the month | TEST-UNEXPECTED-FAIL | xpcshell-libical.ini:calendar/test/unit/test_alarmservice.js 1244818 Icaljs failure on first day of the month | TEST-UNEXPECTED-FAIL | xpcshell-icaljs.ini:calendar/test/unit/test_alarmservice.js TEST-UNEXPECTED-FAIL | xpcshell-icaljs.ini:calendar/test/unit/test_alarmservice.js | test_addItems - [test_addItems : 12] false == true 1239148 Permanent debug test_alarmservice.js | xpcshell return code: 1 | application crashed [@ js::TypeFailure(JSContext *,char const *,...)] 1261688 libical failure on first day of the month | TEST-UNEXPECTED-FAIL | xpcshell-libical.ini:calendar/test/unit/test_alarmservice.js 1244818 Icaljs failure on first day of the month | TEST-UNEXPECTED-FAIL | xpcshell-icaljs.ini:calendar/test/unit/test_alarmservice.js TEST-UNEXPECTED-FAIL | xpcshell-libical.ini:calendar/test/unit/test_alarmservice.js | xpcshell return code: 0 1239148 Permanent debug test_alarmservice.js | xpcshell return code: 1 | application crashed [@ js::TypeFailure(JSContext *,char const *,...)] 1261688 libical failure on first day of the month | TEST-UNEXPECTED-FAIL | xpcshell-libical.ini:calendar/test/unit/test_alarmservice.js 1244818 Icaljs failure on first day of the month | TEST-UNEXPECTED-FAIL | xpcshell-icaljs.ini:calendar/test/unit/test_alarmservice.js TEST-UNEXPECTED-FAIL | xpcshell-libical.ini:calendar/test/unit/test_alarmservice.js | test_addItems - [test_addItems : 12] false == true 1239148 Permanent debug test_alarmservice.js | xpcshell return code: 1 | application crashed [@ js::TypeFailure(JSContext *,char const *,...)] 1261688 libical failure on first day of the month | TEST-UNEXPECTED-FAIL | xpcshell-libical.ini:calendar/test/unit/test_alarmservice.js 1244818 Icaljs failure on first day of the month | TEST-UNEXPECTED-FAIL | xpcshell-icaljs.ini:calendar/test/unit/test_alarmservice.js
Attached patch patch - v1 (obsolete) — Splinter Review
All the logs show an error in the test "addTestItems Test 7" that had to be fixed with the patch for bug 1261688 but seems that the sequence of alarm status for the 1st of December is wrong. I re-tested again the test for the first day of every month by changing date/time on my OS and all the months works fine. I hope that all the sequences are right this time.
Assignee: nobody → bv1578
Status: NEW → ASSIGNED
Attachment #8817027 - Flags: review?(philipp)
Comment on attachment 8817027 [details] [diff] [review] patch - v1 Review of attachment 8817027 [details] [diff] [review]: ----------------------------------------------------------------- Sure, let us try it!
Attachment #8817027 - Flags: review?(philipp) → review+
I've waited for the first day of a new month to run a test on the try server: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=61eaceb5a0ec4181ff8bfcb97a727f5a91facd13 Now we get an error on the test "addTestItems Test 6" that is different from those ones reported in comment 5 ("addTestItems Test 7") that occurred also with libical. This is caused by a daily recurrence test: https://dxr.mozilla.org/comm-central/source/calendar/test/unit/test_alarmservice.js#229 and probably is the original issue because it occurs only with ical.js (when this bug was opened, it was very hard to distinguish the test that failed because there weren't informative messages).
Attached patch patch - v2 (obsolete) — Splinter Review
Currently I can reproduce, locally, only on the 1st of December and 1st of January of every year. As mentioned above, the issue on the 1st of January concerns only icaljs about the test "addTestItems Test 6". As far as I can see, this case depends on the automatic normalization of the date. The function createEventWithAlarm() uses a date that has not (completely) updated after the hour has been changed: https://dxr.mozilla.org/comm-central/source/calendar/test/unit/test_alarmservice.js#230 Adding a code line that reads the attribute "hour" causes a call to the "get" method which completes (or starts) the normalization: https://dxr.mozilla.org/comm-central/source/calendar/base/modules/ical.js#5635 This patch includes the previous one so it fixes the issues on both the dates (verified locally). I wouldn't know how to do a different fix without changing the way the normalization works in icaljs. What's your opinion Philipp?
Attachment #8817027 - Attachment is obsolete: true
Attachment #8833683 - Flags: review?(philipp)
Attached patch patch - v3Splinter Review
I've eliminated the fix required for the failure on the 1st of December because I've included it in the patch for bug 1352148 that changes a bit that part of the code. In this patch there's only the fix for the failure caused by icaljs.
Attachment #8833683 - Attachment is obsolete: true
Attachment #8833683 - Flags: review?(philipp)
Attachment #8854182 - Flags: review?(philipp)
Comment on attachment 8854182 [details] [diff] [review] patch - v3 Review of attachment 8854182 [details] [diff] [review]: ----------------------------------------------------------------- Is there another way to force normalization, or can we fix something in the wrapper instead that would avoid us having to add this hack?
Ah I see you already thought about that in the comment before. I will see if I can find out a solution.
Flags: needinfo?(philipp)
Comment on attachment 8854182 [details] [diff] [review] patch - v3 Review of attachment 8854182 [details] [diff] [review]: ----------------------------------------------------------------- It doesn't look like I'm going to find time to work on a different solution for the time being, but of course it would be great to get this bug fixed. To set expectations I'm removing the review flag, if you happen to come up with something I'm happy to review a bit quicker next time!
Attachment #8854182 - Flags: review?(philipp)
Flags: needinfo?(philipp)

How come this went perma-red just now?

Flags: needinfo?(geoff)

Check the date and the summary of this bug.

Flags: needinfo?(geoff)

Oh, the 1st of the month thing. Did we not fix that ages ago? I see, this has a long history, see bug 1352148 comment #6 which refers to this bug here. But why didn't it fail on the 1st Dec 2019:
https://treeherder.mozilla.org/#/jobs?repo=comm-central&revision=7dcc5e7050596410102eb42e30fdf1003e3477d8
https://treeherder.mozilla.org/#/jobs?repo=comm-central&revision=8c2f8de771068d5bc849a4e1c5c33329f1e7ea01
https://treeherder.mozilla.org/#/jobs?repo=comm-central&revision=a0470cab33c08920a9b7644048e36144ce05d396

I don't want to scroll back to the 1st Nov 2019, but I can't remember seeing this bug in a while.

Paul, please have a look at resolving this at some point.

Assignee: bv1578 → paul
Status: ASSIGNED → NEW
Assignee: paul → nobody
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME

Happened again Jan 1 2023. Maybe it's just 1.1 now...

Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Status: REOPENED → NEW
Severity: normal → S3

Happens this year as well (no surprise).
I can confirm the attach patch would fix it. It might be reasonable to take it as it seems it could be a test bug for the most part.
There is similar "normalization" here: https://searchfox.org/comm-central/rev/4deb3ffcf75305d3eb5c326e588317efe2508564/calendar/base/modules/Ical.jsm#7848

Mass closure of all bugs in the Calendar, MailNews Core, and Thunderbird components with the "intermittent-failure" keyword and no activity in the last six months.

Status: NEW → RESOLVED
Closed: 3 years ago3 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: