@@ -1035,7 +1035,7 @@ describe(DBTransaction.name, () => {
10351035 ) ;
10361036 await db . withTransactionF ( async ( tran2 ) => {
10371037 await tran2 . lock ( [ 'foo' , 'read' ] ) ;
1038- await expect ( tran2 . lock ( [ 'bar' , 'write' , 0 ] ) ) . rejects . toThrow (
1038+ await expect ( tran2 . lock ( [ 'bar' , 'write' , { timer : 0 } ] ) ) . rejects . toThrow (
10391039 locksErrors . ErrorAsyncLocksTimeout ,
10401040 ) ;
10411041 expect ( tran1 . locks . size ) . toBe ( 2 ) ;
@@ -1097,7 +1097,7 @@ describe(DBTransaction.name, () => {
10971097 // This is a noop, because `tran1` owns `key1` and `key2`
10981098 await tran2 . unlock ( 'key1' , 'key2' ) ;
10991099 // This fails because `key1` is still locked by `tran1`
1100- await expect ( tran2 . lock ( [ 'key1' , 'write' , 0 ] ) ) . rejects . toThrow (
1100+ await expect ( tran2 . lock ( [ 'key1' , 'write' , { timer : 0 } ] ) ) . rejects . toThrow (
11011101 locksErrors . ErrorAsyncLocksTimeout ,
11021102 ) ;
11031103 await tran1 . unlock ( 'key1' ) ;
@@ -1109,7 +1109,7 @@ describe(DBTransaction.name, () => {
11091109 await tran1 . unlock ( 'key1' ) ;
11101110 expect ( tran2 . locks . has ( 'key1' ) ) . toBe ( true ) ;
11111111 expect ( tran1 . locks . has ( 'key1' ) ) . toBe ( false ) ;
1112- await expect ( tran1 . lock ( [ 'key1' , 'write' , 0 ] ) ) . rejects . toThrow (
1112+ await expect ( tran1 . lock ( [ 'key1' , 'write' , { timer : 0 } ] ) ) . rejects . toThrow (
11131113 locksErrors . ErrorAsyncLocksTimeout ,
11141114 ) ;
11151115 } ) ;
@@ -1126,8 +1126,8 @@ describe(DBTransaction.name, () => {
11261126 // Currently a deadlock can happen, and the only way to avoid is to use timeouts
11271127 // In the future, we want to have `DBTransaction` detect deadlocks
11281128 // and automatically give us `ErrorDBTransactionDeadlock` exception
1129- const p1 = tran1 . lock ( [ 'bar' , 'write' , 50 ] ) ;
1130- const p2 = tran2 . lock ( [ 'foo' , 'write' , 50 ] ) ;
1129+ const p1 = tran1 . lock ( [ 'bar' , 'write' , { timer : 50 } ] ) ;
1130+ const p2 = tran2 . lock ( [ 'foo' , 'write' , { timer : 50 } ] ) ;
11311131 const results = await Promise . allSettled ( [ p1 , p2 ] ) ;
11321132 expect (
11331133 results . every (
0 commit comments