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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Lina Cambridge 2019-08-15 01:28:50 +00:00
Родитель 80fa6900e1
Коммит 1e3d00af59
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -11,8 +11,8 @@ add_task(async function test_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"
);