Bug 1573738 - Test aborting application, not only merging. a=testonly
authorLina Cambridge <lina@yakshaving.ninja>
Thu, 15 Aug 2019 01:28:50 +0000
changeset 488169 2e7460e2a73e061e3bc75646dc7d8b5e76943160
parent 488168 7e5760b1988ce1c47ddcaf63750ca5801aa1da6f
child 488170 f5cc355f51aa846cbb998b5d49bafc2ead3bfa53
push id113904
push userncsoregi@mozilla.com
push dateThu, 15 Aug 2019 19:41:00 +0000
treeherdermozilla-inbound@b283a7ef186c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1573738
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1573738 - Test aborting application, not only merging. a=testonly `SyncedBookmarksMirror::merge` is racy: the storage thread might finish merging before it gets the cancellation signal. However, `apply` also notifies observers and fetches records, which happen after we've aborted our JS controller. Even if the Rust op isn't canceled in time, we should still abort the remaining operations. Differential Revision: https://phabricator.services.mozilla.com/D42065
toolkit/components/places/tests/sync/test_bookmark_abort_merging.js
--- a/toolkit/components/places/tests/sync/test_bookmark_abort_merging.js
+++ b/toolkit/components/places/tests/sync/test_bookmark_abort_merging.js
@@ -6,18 +6,18 @@ var { AsyncShutdown } = ChromeUtils.impo
 );
 
 add_task(async function test_abort_merging() {
   let buf = await openMirror("abort_merging");
 
   let controller = new AbortController();
   controller.abort();
   await Assert.rejects(
-    buf.merge(controller.signal),
-    /Operation aborted/,
+    buf.apply({ signal: controller.signal }),
+    ex => ex.name == "InterruptedError",
     "Should abort merge when signaled"
   );
 
   // Even though the merger is already finalized on the Rust side, the DB
   // connection is still open on the JS side. Finalizing `buf` closes it.
   await buf.finalize();
   await PlacesUtils.bookmarks.eraseEverything();
   await PlacesSyncUtils.bookmarks.reset();