Calculate timeout test delta from the given timeout

Co-authored-by: Joshua Wise <[email protected]>
This commit is contained in:
Mahesh Bandara Wijerathna
2023-09-05 12:43:21 +05:30
co-authored by Joshua Wise
parent 87cc6a7d0b
commit 49c9688037
+1 -1
View File
@@ -98,7 +98,7 @@ describe('new Database()', function () {
const start = Date.now();
expect(() => db.exec('BEGIN EXCLUSIVE')).to.throw(Database.SqliteError).with.property('code', 'SQLITE_BUSY');
const end = Date.now();
expect(end - start).to.be.closeTo(timeout, 1200);
expect(end - start).to.be.within(timeout - 1, timeout * 3 + 100);
} finally {
db.close();
}