Closed Bug 1445226 Opened 6 years ago Closed 6 years ago

Port Bug 1435446 part 3 "Add a default transaction type for storage connections" to Calendar - Many Xpcshell and Mozmill failures

Categories

(Calendar :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jorgk-bmo, Assigned: jorgk-bmo)

Details

Attachments

(2 files, 3 obsolete files)

TEST-UNEXPECTED-FAIL | /Users/cltbld/tasks/task_1520941181/build/tests/mozmill/cal-recurrence/testAnnualRecurrence.js | testAnnualRecurrence.js::setupModule
TEST-UNEXPECTED-FAIL | /Users/cltbld/tasks/task_1520941181/build/tests/mozmill/cal-recurrence/testBiweeklyRecurrence.js | testBiweeklyRecurrence.js::setupModule
TEST-UNEXPECTED-FAIL | /Users/cltbld/tasks/task_1520941181/build/tests/mozmill/cal-recurrence/testDailyRecurrence.js | testDailyRecurrence.js::setupModule
TEST-UNEXPECTED-FAIL | /Users/cltbld/tasks/task_1520941181/build/tests/mozmill/cal-recurrence/testLastDayOfMonthRecurrence.js | testLastDayOfMonthRecurrence.js::setupModule
TEST-UNEXPECTED-FAIL | /Users/cltbld/tasks/task_1520941181/build/tests/mozmill/cal-recurrence/testWeeklyNRecurrence.js | testWeeklyNRecurrence.js::setupModule
TEST-UNEXPECTED-FAIL | /Users/cltbld/tasks/task_1520941181/build/tests/mozmill/cal-recurrence/testWeeklyUntilRecurrence.js | testWeeklyUntilRecurrence.js::setupModule
TEST-UNEXPECTED-FAIL | /Users/cltbld/tasks/task_1520941181/build/tests/mozmill/cal-recurrence/testWeeklyWithExceptionRecurrence.js | testWeeklyWithExceptionRecurrence.js::setupModule

Those logs say:
https://taskcluster-artifacts.net/Zd9jKn_wQ-ueKPWrTRliIw/0/public/logs/live_backing.log
JavaScript error: resource://calendar/modules/calUtils.jsm -> file:///Users/cltbld/tasks/task_1520941181/build/application/Thunderbird%20Daily.app/Contents/Resources/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/calendar-js/calCalendarManager.js, line 326: TypeError: db.beginTransactionAs is not a function

This was removed here:
https://hg.mozilla.org/mozilla-central/rev/f8a3b9547dbc#l3.24

We use it a few times:
https://dxr.mozilla.org/comm-central/search?q=beginTransactionAs&redirect=false

There are also failures in
mozmill/testBasicFunctionality.js | testBasicFunctionality.js::testSmokeTest
mozmill/testLocalICS.js | testLocalICS.js::testLocalICS
mozmill/testTodayPane.js | testTodayPane.js::setupModule
which may be the same thing.

In the logs I see 
https://taskcluster-artifacts.net/Q-BC7bsOSUaWrJmB08O2MQ/0/public/logs/live_backing.log
INFO -  TEST-START | /Users/cltbld/tasks/task_1520941342/build/tests/mozmill/testBasicFunctionality.js | testSmokeTest
INFO -  TypeError: view is null
and also
INFO -  JavaScript error: chrome://calendar/content/calendar-management.js, line 121: NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: [JavaScript Error: "right-hand side of 'in' should be an object, got undefined" {file: "resource://calendar/modules/calUtils.jsm -> file:///Users/cltbld/tasks/task_1520941342/build/application/Thunderbird%20DailyDebug.app/Contents/Resources/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/calendar-js/calCalendarManager.js" line: 563}]'[JavaScript Error: "right-hand side of 'in' should be an object, got undefined" {file: "resource://calendar/modules/calUtils.jsm -> file:///Users/cltbld/tasks/task_1520941342/build/application/Thunderbird%20DailyDebug.app/Contents/Resources/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/calendar-js/calCalendarManager.js" line: 563}]' when calling method: [calICalendarManager::registerCalendar]

but that may be follow-on errors.

Marco, what's the replacement? Maybe:
db.defaultTransaction = xx;
db.beginTransaction();
Flags: needinfo?(mak77)
So here is the replacement. Still untested, my local build isn't finished yet.
Attachment #8958434 - Flags: feedback?(mak77)
Hmm, running one of the failing Xpcshell tests
  mozilla/mach xpcshell-test calendar/test/unit/test_alarmutils.js
I get
JavaScript error: resource://calendar/modules/calUtils.jsm -> file:///c:/mozilla-source/comm-central/obj-x86_64-pc-mingw32/dist/bin/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/calendar-js/calCalendarManager.js, line 326: NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN: Cannot modify properties of a WrappedNative

so
db.defaultTransaction = Components.interfaces.mozIStorageConnection.TRANSACTION_EXCLUSIVE;
isn't the right thing to do.

Oops, that should be defaultTransactionType as can be seen here:
https://hg.mozilla.org/mozilla-central/rev/f8a3b9547dbc#l7.33
Summary: Port Bug 1435446 part 3 "Add a default transaction type for storage connections" to Calendar - Many Mozmill failures → Port Bug 1435446 part 3 "Add a default transaction type for storage connections" to Calendar - Many Xpcshell and Mozmill failures
This appears to be working.
Assignee: nobody → jorgk
Attachment #8958434 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8958434 - Flags: feedback?(mak77)
Flags: needinfo?(mak77)
Attachment #8958473 - Flags: review?(philipp)
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/c3a61fde3260
Port Bug 1435446: Replace use of beginTransactionAs(). rs=bustage-fix DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Philipp, please set up target milestone 6.3.
Comment on attachment 8958473 [details] [diff] [review]
1445226-replace-use-of-beginTransactionAs.patch (v2)

Review of attachment 8958473 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with these changes:

::: calendar/providers/storage/calStorageCalendar.js
@@ +230,5 @@
>                      }
>                  }
>                  try {
>                      // hold lock on storage.sdb until we've migrated data from storage.sdb:
> +                    this.mDB.defaultTransactionType = Components.interfaces.mozIStorageConnection.TRANSACTION_EXCLUSIVE;

Given this sets a default, I'd prefer to move this line directly after the respective openDatabase call.

@@ +272,5 @@
>  
>              // WARNING: This is a somewhat fragile process. Great care should be
>              // taken during future schema upgrades to make sure this still
>              // works.
> +            this.mDB.defaultTransactionType = Components.interfaces.mozIStorageConnection.TRANSACTION_EXCLUSIVE;

Same here.
Attachment #8958473 - Flags: review?(philipp) → review+
Target Milestone: --- → 6.3
Attached patch 1445226-follow-up.patch (obsolete) β€” β€” Splinter Review
Note the |this.mDB = localDB;|.
Attachment #8958746 - Flags: review?(philipp)
Attached patch 1445226-follow-up.patch (obsolete) β€” β€” Splinter Review
Oops.
Attachment #8958746 - Attachment is obsolete: true
Attachment #8958746 - Flags: review?(philipp)
Attachment #8958747 - Flags: review?(philipp)
Attached patch 1445226-follow-up.patch β€” β€” Splinter Review
3rd time lucky, sorry about the noise.
Attachment #8958747 - Attachment is obsolete: true
Attachment #8958747 - Flags: review?(philipp)
Attachment #8958748 - Flags: review?(philipp)
Comment on attachment 8958748 [details] [diff] [review]
1445226-follow-up.patch

Review of attachment 8958748 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!
Attachment #8958748 - Flags: review?(philipp) → review+
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/7e4813dc7c60
Follow-up: Move setting defaultTransactionType to after openDatabase(). r=philipp
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: