Fix DB timeout test after 078e3bb079
This commit is contained in:
parent
ca3fd80825
commit
9cdcb2fd7c
1 changed files with 11 additions and 4 deletions
|
@ -309,11 +309,18 @@ describe("Zotero.DB", function() {
|
||||||
yield Zotero.DB.queryAsync("DROP TABLE " + tmpTable);
|
yield Zotero.DB.queryAsync("DROP TABLE " + tmpTable);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should time out on nested transactions", function* () {
|
it("should time out on nested transactions", async function () {
|
||||||
var e;
|
var e;
|
||||||
yield Zotero.DB.executeTransaction(function* () {
|
await Zotero.DB.executeTransaction(async function () {
|
||||||
e = yield getPromiseError(
|
e = await getPromiseError(
|
||||||
Zotero.DB.executeTransaction(function* () {}).timeout(250)
|
Promise.race([
|
||||||
|
Zotero.Promise.delay(250).then(() => {
|
||||||
|
var e = new Error;
|
||||||
|
e.name = "TimeoutError";
|
||||||
|
throw e;
|
||||||
|
}),
|
||||||
|
Zotero.DB.executeTransaction(async function () {})
|
||||||
|
])
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
assert.ok(e);
|
assert.ok(e);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue